Re: Issues with chrome.manifest when installed in path having japanese characters

Benjamin Smedberg <[email protected]> Thu, 14 Aug 2014 10:07:44 -0400
Newsgroups gmane.comp.mozilla.devel.embedding
Message-ID <[email protected]>
On 8/14/2014 9:58 AM, [email protected] wrote:
> I am not sure if your problem is identical to one I recently had to solve.
> XRE_InitEmbedding2Type on Windows uses ReadDependentCB() and TS_tfopen()
> internally (implemented in nsXPCOMGlue.cpp. In the 2 helpers, which both
> take char* parameters,  the MultibyteToWideChar conversion used the CP_UTF8
> flag. If your path contains MBCS double byte characters then this conversion
> will produce garbage.

This is correct and intentional: see the comment at 
http://mxr.mozilla.org/mozilla-central/source/xpcom/build/nsXULAppAPI.h#155

We do this because on Windows the native charset doesn't represent 
unicode. So we use a wmain entry point and wchar, and convert to UTF8 
immediately so that we can use a shared char* interface with all the 
other platforms.

--BDS