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. 

The 'fix' I used here was to was to call lcid() to get the current locale
and pass that value to MultibyteToWideChar instead of CP_UTF8. This works
when the correct locale is set (Region & language) but will still fail if
you have mixed DBCS character strings. 

I suspect the right thing to do here is actually modify the embedding API to
use wchar_t for filenames etc, which is how things are (correctly) handled
within  the main codebase.

-----Original Message-----
From: dev-embedding
[mailto:dev-embedding-bounces+g4=novadsp....@lists.mozilla.org] On Behalf Of
bhargava.animes...@gmail.com
Sent: 14 August 2014 14:09
To: dev-embedding@lists.mozilla.org
Subject: Re: Issues with chrome.manifest when installed in path having
japanese characters


In our code , we are having following snippet :

rv = NS_NewNativeLocalFile(nsEmbedCString((char *)filepath), PR_FALSE,
getter_AddRefs(libxul)); 
        if (NS_FAILED(rv)) 
        { 
                throw BALBrowserException();
        } 


        rv = NS_NewNativeLocalFile( nsEmbedCString((char *)filepath),
PR_FALSE, getter_AddRefs(appDir)); 
        if(NS_FAILED(rv)) 
        { 
                throw BALBrowserException();
        } 
        rv = XRE_InitEmbedding(libxul, appDir, 0); 

rv in each case is NS_OK . After execution of 'XRE_InitEmbedding(libxul,
appDir, 0); '  we are getting the chrome.manifest error. I have checked
filepath ( containing japanese characters) , it is correct. 
Is there any other way by which we can register our JS and binary components
? 
I'll log a bug separately and cc you.

        
_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding


_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to