{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/24674","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/24674/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/24674/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/24674/events","html_url":"https://github.com/nodejs/node/issues/24674","id":384875224,"node_id":"MDU6SXNzdWUzODQ4NzUyMjQ=","number":24674,"title":"Intl.NumberFormat#format returns white space charCode 160 instead charCode 32","user":{"login":"gtkatakura-bysoft","id":16100409,"node_id":"MDQ6VXNlcjE2MTAwNDA5","avatar_url":"https://avatars0.githubusercontent.com/u/16100409?v=4","gravatar_id":"","url":"https://api.github.com/users/gtkatakura-bysoft","html_url":"https://github.com/gtkatakura-bysoft","followers_url":"https://api.github.com/users/gtkatakura-bysoft/followers","following_url":"https://api.github.com/users/gtkatakura-bysoft/following{/other_user}","gists_url":"https://api.github.com/users/gtkatakura-bysoft/gists{/gist_id}","starred_url":"https://api.github.com/users/gtkatakura-bysoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtkatakura-bysoft/subscriptions","organizations_url":"https://api.github.com/users/gtkatakura-bysoft/orgs","repos_url":"https://api.github.com/users/gtkatakura-bysoft/repos","events_url":"https://api.github.com/users/gtkatakura-bysoft/events{/privacy}","received_events_url":"https://api.github.com/users/gtkatakura-bysoft/received_events","type":"User","site_admin":false},"labels":[{"id":246210555,"node_id":"MDU6TGFiZWwyNDYyMTA1NTU=","url":"https://api.github.com/repos/nodejs/node/labels/intl","name":"intl","color":"506b95","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-27T16:20:20Z","updated_at":"2018-11-28T10:34:43Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for reporting a possible bug in Node.js.\r\n\r\nPlease fill in as much of the template below as you can.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify the affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you can.\r\n-->\r\n\r\n* **Version**: 10.13.0\r\n* **Platform**: Darwin Gabriel-TK.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar  5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64\r\n* **Subsystem**:\r\n\r\n<!-- Please provide more details below this comment. -->\r\n\r\ncode:\r\n\r\n```js\r\nconst toShow = (money, format = 'BRL') => {\r\n  const options = { style: 'currency', currency: format };\r\n  const numberFormat = new Intl.NumberFormat('pt-BR', options);\r\n  return numberFormat.format(money);\r\n};\r\n\r\nconsole.log([...toShow(1001)].map(f => f.charCodeAt(0)))\r\nconsole.log([...'R$ 1,001.00'].map(f => f.charCodeAt(0)))\r\nconsole.log(toShow(1001) === 'R$ 1,001.00')\r\n```\r\n\r\noutput:\r\n```bash\r\n~/Projects/gtkatakura/test $ node intl-format.js \r\n[ 82, 36, 160, 49, 44, 48, 48, 49, 46, 48, 48 ]\r\n[ 82, 36, 32, 49, 44, 48, 48, 49, 46, 48, 48 ]\r\nfalse\r\n```"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/442399625","html_url":"https://github.com/nodejs/node/issues/24674#issuecomment-442399625","issue_url":"https://api.github.com/repos/nodejs/node/issues/24674","id":442399625,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjM5OTYyNQ==","user":{"login":"gtkatakura-bysoft","id":16100409,"node_id":"MDQ6VXNlcjE2MTAwNDA5","avatar_url":"https://avatars0.githubusercontent.com/u/16100409?v=4","gravatar_id":"","url":"https://api.github.com/users/gtkatakura-bysoft","html_url":"https://github.com/gtkatakura-bysoft","followers_url":"https://api.github.com/users/gtkatakura-bysoft/followers","following_url":"https://api.github.com/users/gtkatakura-bysoft/following{/other_user}","gists_url":"https://api.github.com/users/gtkatakura-bysoft/gists{/gist_id}","starred_url":"https://api.github.com/users/gtkatakura-bysoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtkatakura-bysoft/subscriptions","organizations_url":"https://api.github.com/users/gtkatakura-bysoft/orgs","repos_url":"https://api.github.com/users/gtkatakura-bysoft/repos","events_url":"https://api.github.com/users/gtkatakura-bysoft/events{/privacy}","received_events_url":"https://api.github.com/users/gtkatakura-bysoft/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T10:34:43Z","updated_at":"2018-11-28T10:34:43Z","author_association":"NONE","body":"Hm, makes sense. However, I think that methods like format should document this use case. I have already seen several cases of people trying to make a comparison between strings have this problem (comparing text), and lost time until they notice that the problem is in charCode."}}
{"actor":{"display_login":"gtkatakura-bysoft"}}