{"action":"opened","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/8468","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/8468/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/8468/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/8468/events","html_url":"https://github.com/nim-lang/Nim/issues/8468","id":345394413,"node_id":"MDU6SXNzdWUzNDUzOTQ0MTM=","number":8468,"title":"devel branch encodings.convert broken on Windows","user":{"login":"johnnovak","id":698770,"node_id":"MDQ6VXNlcjY5ODc3MA==","avatar_url":"https://avatars0.githubusercontent.com/u/698770?v=4","gravatar_id":"","url":"https://api.github.com/users/johnnovak","html_url":"https://github.com/johnnovak","followers_url":"https://api.github.com/users/johnnovak/followers","following_url":"https://api.github.com/users/johnnovak/following{/other_user}","gists_url":"https://api.github.com/users/johnnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnovak/subscriptions","organizations_url":"https://api.github.com/users/johnnovak/orgs","repos_url":"https://api.github.com/users/johnnovak/repos","events_url":"https://api.github.com/users/johnnovak/events{/privacy}","received_events_url":"https://api.github.com/users/johnnovak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-27T23:33:06Z","updated_at":"2018-07-27T23:33:06Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Using devel branch Nim, the below code results in a segfault on *Windows only* (runs fine on OS X and Linux):\r\n\r\n```nim\r\nimport encodings\r\n\r\nvar utf16LEConverter = open(destEncoding = \"utf-16\", srcEncoding = \"utf-8\")\r\nvar s = \"some string\"\r\nvar c = utf16LEConverter.convert(s)\r\n```\r\n\r\n```\r\nconverttest.nim(5)       converttest\r\nencodings.nim(339)       convert\r\nSIGSEGV: Illegal storage access. (Attempt to read from nil?)\r\nError: execution of an external program failed: 'd:\\Work\\Code\\illwill\\converttest.exe '\r\n```\r\n\r\nDiffed `encodings.nim` with the `v0.18.0` version, couldn't see any significant difference. Maybe something at the compiler level? `encodings.nim` just calls a Windows API, maybe something fails when converting the parameters to make that call?\r\n\r\nI tested this on Windows 7 x64 only, if that matters at all. Nim version:\r\n\r\n```\r\nNim Compiler Version 0.18.1 [Windows: amd64]\r\nCompiled at 2018-07-28\r\nCopyright (c) 2006-2018 by Andreas Rumpf\r\n\r\ngit hash: 8b638ae59991009d6b0b08af2bcf48c11a04eaa2\r\nactive boot switches: -d:release\r\n```"}}
{"actor":{"display_login":"johnnovak"}}