{"action":"opened","issue":{"url":"https://api.github.com/repos/fmtlib/fmt/issues/572","repository_url":"https://api.github.com/repos/fmtlib/fmt","labels_url":"https://api.github.com/repos/fmtlib/fmt/issues/572/labels{/name}","comments_url":"https://api.github.com/repos/fmtlib/fmt/issues/572/comments","events_url":"https://api.github.com/repos/fmtlib/fmt/issues/572/events","html_url":"https://github.com/fmtlib/fmt/issues/572","id":260095151,"number":572,"title":"printf %ls support - C++ standard compatibility","user":{"login":"vgalka-sl","id":30044721,"avatar_url":"https://avatars3.githubusercontent.com/u/30044721?v=4","gravatar_id":"","url":"https://api.github.com/users/vgalka-sl","html_url":"https://github.com/vgalka-sl","followers_url":"https://api.github.com/users/vgalka-sl/followers","following_url":"https://api.github.com/users/vgalka-sl/following{/other_user}","gists_url":"https://api.github.com/users/vgalka-sl/gists{/gist_id}","starred_url":"https://api.github.com/users/vgalka-sl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgalka-sl/subscriptions","organizations_url":"https://api.github.com/users/vgalka-sl/orgs","repos_url":"https://api.github.com/users/vgalka-sl/repos","events_url":"https://api.github.com/users/vgalka-sl/events{/privacy}","received_events_url":"https://api.github.com/users/vgalka-sl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-24T16:01:11Z","updated_at":"2017-09-24T16:01:11Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nThe current library version does not allow mixing wchar_t* arguments into char* format strings. The following code does not compile (at least not on MS VS2017):\r\n\r\n`fmt::printf(\"%ls\", L\"foo\");`\r\n\r\nHowever, according to the C++11 standard, it should be valid for printf-like functions.\r\n> C++11 includes the C library as described by the 1999 ISO C standard and its Technical Corrigenda 1, 2 and 3 (ISO/IEC 9899:1999 and ISO/IEC 9899:1999/Cor.1,2,3), plus <cuchar> (as by ISO/IEC 19769:2004).\r\n\r\nLooking into [ISO/IEC 9899:TC2](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf), it describes the %ls format specifier as following (page 279):\r\n\r\n> If an l length modifier is present, the argument shall be a pointer to the initial element of an array of wchar_t type. Wide characters from the array are converted to multibyte characters (each as if by a call to the wcrtomb function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting multibyte characters are written up to (but not including) the terminating null character (byte).\r\n\r\nBest regards,\r\nVasili"}}
{"actor":{"display_login":"vgalka-sl"}}