Show
Ignore:
Timestamp:
08/11/08 20:37:08 (2 years ago)
Author:
callum.linden
Message:

Fix via patch from Nyx for DEV-14335 - fixes crash on Korean versions of Windows when username (and therefore path to profile information) contains Korean characters.
Reviewed by me - fix by Nyx.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/llmozlib2/llembeddedbrowser.cpp

    r15 r17  
    137137        mNativeWindowHandle = nativeWindowHandleIn; 
    138138 
     139    NS_ConvertUTF8toUTF16 applicationDirUTF16(applicationDir.c_str()); 
     140    NS_ConvertUTF8toUTF16 componentDirUTF16(componentDir.c_str()); 
     141        NS_ConvertUTF8toUTF16 profileDirUTF16(profileDir.c_str()); 
     142 
    139143        nsCOMPtr< nsILocalFile > applicationDirNative; 
    140         nsresult result = NS_NewNativeLocalFile( nsCString( applicationDir.c_str() ), PR_FALSE, getter_AddRefs( applicationDirNative ) ); 
     144        nsresult result = NS_NewLocalFile( applicationDirUTF16, PR_FALSE, getter_AddRefs( applicationDirNative ) ); 
    141145        if ( NS_FAILED( result ) ) 
    142146        { 
     
    146150 
    147151        nsCOMPtr< nsILocalFile > componentDirNative; 
    148         result = NS_NewNativeLocalFile( nsCString( componentDir.c_str() ), PR_FALSE, getter_AddRefs( componentDirNative ) ); 
     152        result = NS_NewLocalFile( componentDirUTF16 , PR_FALSE, getter_AddRefs( componentDirNative ) ); 
    149153        if ( NS_FAILED( result ) ) 
    150154        { 
     
    161165 
    162166        nsCOMPtr< nsILocalFile > profileDirNative; 
    163         result = NS_NewNativeLocalFile( nsCString( profileDir.c_str() ), PR_TRUE, getter_AddRefs( profileDirNative ) ); 
     167        result = NS_NewLocalFile( profileDirUTF16 , PR_TRUE, getter_AddRefs( profileDirNative ) ); 
    164168        if ( NS_FAILED( result ) ) 
    165169        {