{"action":"opened","issue":{"url":"https://api.github.com/repos/ec4j/ec4j/issues/97","repository_url":"https://api.github.com/repos/ec4j/ec4j","labels_url":"https://api.github.com/repos/ec4j/ec4j/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/ec4j/ec4j/issues/97/comments","events_url":"https://api.github.com/repos/ec4j/ec4j/issues/97/events","html_url":"https://github.com/ec4j/ec4j/issues/97","id":393689204,"node_id":"MDU6SXNzdWUzOTM2ODkyMDQ=","number":97,"title":"Read write empty uft-8-bom encoded files properly","user":{"login":"ppalaga","id":1826249,"node_id":"MDQ6VXNlcjE4MjYyNDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1826249?v=4","gravatar_id":"","url":"https://api.github.com/users/ppalaga","html_url":"https://github.com/ppalaga","followers_url":"https://api.github.com/users/ppalaga/followers","following_url":"https://api.github.com/users/ppalaga/following{/other_user}","gists_url":"https://api.github.com/users/ppalaga/gists{/gist_id}","starred_url":"https://api.github.com/users/ppalaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppalaga/subscriptions","organizations_url":"https://api.github.com/users/ppalaga/orgs","repos_url":"https://api.github.com/users/ppalaga/repos","events_url":"https://api.github.com/users/ppalaga/events{/privacy}","received_events_url":"https://api.github.com/users/ppalaga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-22T17:17:30Z","updated_at":"2018-12-22T17:17:30Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The fix for #93 I merged yesterday is probably too strict: when reading, it expects each and every `uft-8-bom` encoded file to start with the BOM sequence `0xEF 0xBB 0xBF`. I mean it requires this also for empty files. Similarly, when writing a zero length string to a file, the resulting file contains `0xEF 0xBB 0xBF` and nothing else.\r\n\r\nI have not found any reliable source on the internet that would answer the following questions:\r\n\r\n1. Should zero lenght files be handled as valid for `uft-8-bom` encoding even though they do not start with `0xEF 0xBB 0xBF`?\r\n\r\n2. When writing an empty string to a file using `uft-8-bom` should the resulting file (a) have zero length or (b) it should contain the BOM `0xEF 0xBB 0xBF`?\r\n\r\n@kazuki-ma do you have any idea what is the common practice regarding the above?"}}
{"actor":{"display_login":"ppalaga"}}