[ 
https://issues.apache.org/jira/browse/MESOS-6817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15770767#comment-15770767
 ] 

Andrew Schwartzmeyer commented on MESOS-6817:
---------------------------------------------

In my opinion, we should explicitly use the {{W}} suffixed Windows APIs at all 
times, to guarantee we are given a) the type {{wchar_t*}} and b) data encoded 
with UTF-16, as we can easily and correctly convert this to {{std::string}} 
encoded with UTF-8 using C++'s {{<codecvt>}} library. We _must not_ use the 
non-explicit (non-suffixed) versions of Windows APIs, as we lose type safety 
(the point of this issue: they use the type {{TCHAR}} which is variable, it's 
either {{char_t}} or {{wchar_t}} depending on {{UNICODE}}, which may or may not 
be defined). We _should not_ use the {{A}} suffixed versions as they do not 
guarantee an encoding: instead of standard UTF-16 (or UTF-8 which would be 
reasonable), they encode with the system's current ANSI code page, leaving us 
with an unknown encoding (also, it was deprecated by Unicode; Windows 
development guidelines say to use Unicode).

> Audit the use of UNICODE-related code paths
> -------------------------------------------
>
>                 Key: MESOS-6817
>                 URL: https://issues.apache.org/jira/browse/MESOS-6817
>             Project: Mesos
>          Issue Type: Bug
>          Components: agent
>            Reporter: Alex Clemmer
>            Assignee: Alex Clemmer
>
> Currently we are being kind of lazy about when we're using things like 
> `TCHAR`. Functions like `os::user` will fail when we do something like 
> `std::string` with a `TCHAR` string if the string happens to not be `char`.
> We need to go back to all of these things and audit them so that they don't 
> break if we turn `UNICODE` on.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to