{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/2165","labels_url":"https://api.github.com/repos/nodejs/node/issues/2165/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/2165/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/2165/events","html_url":"https://github.com/nodejs/node/issues/2165","id":94518046,"number":2165,"title":"OS X 10.11: system calls return non-normalized unicode strings","user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/intl","name":"intl","color":"506b95"},{"url":"https://api.github.com/repos/nodejs/node/labels/os%20x","name":"os x","color":"9944dd"},{"url":"https://api.github.com/repos/nodejs/node/labels/test","name":"test","color":"990099"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":37,"created_at":"2015-07-11T23:57:49Z","updated_at":"2015-08-18T14:53:03Z","closed_at":null,"body":"`test/sequential/test-chdir.js` persistently fails on OS X 10.11 because the output of `process.cwd()` doesn't match the path we're doing `process.chdir()` on before.\r\n\r\nHere's a reduced test case (`npm i mkdirp hexy`):\r\n```js\r\nconst mkdirp = require('mkdirp');\r\nconst hex = require('hexy').hexy;\r\nconst dir = __dirname + '/weird \\uc3a4\\uc3ab\\uc3af characters \\u00e1\\u00e2\\u00e3';\r\n\r\nmkdirp.sync(dir);\r\nprocess.chdir(dir);\r\n\r\nconsole.log(hex(new Buffer(dir)));\r\nconsole.log(hex(new Buffer(process.cwd())));\r\nconsole.log(dir.length, dir);\r\nconsole.log(process.cwd().length, process.cwd());\r\n```\r\n\r\nThe strings look identical on the terminal, but the bytes differ. Here's the output:\r\n\r\n```\r\n00000000: 2f55 7365 7273 2f73 696c 7665 7277 696e  /Users/silverwin\r\n00000010: 642f 6769 742f 6368 6469 722f 7765 6972  d/git/chdir/weir\r\n00000020: 6420 ec8e a4ec 8eab ec8e af20 6368 6172  d.l.$l.+l./.char\r\n00000030: 6163 7465 7273 20c3 a1c3 a2c3 a3         acters.C!C\"C#\r\n\r\n00000000: 2f55 7365 7273 2f73 696c 7665 7277 696e  /Users/silverwin\r\n00000010: 642f 6769 742f 6368 6469 722f 7765 6972  d/git/chdir/weir\r\n00000020: 6420 e184 8ae1 85a7 e186 abe1 848a e185  d.a..a.'a.+a..a.\r\n00000030: a7e1 86b2 e184 8ae1 85a7 e186 b620 6368  'a.2a..a.'a.6.ch\r\n00000040: 6172 6163 7465 7273 2061 cc81 61cc 8261  aracters.aL.aL.a\r\n00000050: cc83                                     L.\r\n\r\n52 '/Users/silverwind/git/chdir/weird 쎤쎫쎯 characters áâã'\r\n61 '/Users/silverwind/git/chdir/weird 쎤쎫쎯 characters áâã'\r\n```\r\ncc: @evanlucas"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/132238628","html_url":"https://github.com/nodejs/node/issues/2165#issuecomment-132238628","issue_url":"https://api.github.com/repos/nodejs/node/issues/2165","id":132238628,"user":{"login":"jorangreef","id":413206,"avatar_url":"https://avatars.githubusercontent.com/u/413206?v=3","gravatar_id":"","url":"https://api.github.com/users/jorangreef","html_url":"https://github.com/jorangreef","followers_url":"https://api.github.com/users/jorangreef/followers","following_url":"https://api.github.com/users/jorangreef/following{/other_user}","gists_url":"https://api.github.com/users/jorangreef/gists{/gist_id}","starred_url":"https://api.github.com/users/jorangreef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorangreef/subscriptions","organizations_url":"https://api.github.com/users/jorangreef/orgs","repos_url":"https://api.github.com/users/jorangreef/repos","events_url":"https://api.github.com/users/jorangreef/events{/privacy}","received_events_url":"https://api.github.com/users/jorangreef/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T14:53:03Z","updated_at":"2015-08-18T14:53:03Z","body":"@bpasero if normalization were built in, then you would hit some corner cases where you would lose data. I think it's better to handle normalization at the application level and try and understand what the platforms do rather than ignore it. The differences can't be abstracted in a leak free way."}}