OK, here are the reasons why:
1. In nsMsgLocalMailFolder::CreateSubfolder() we call
NS_MsgHashAutoStringIfNecessary() directly to make sure that we have a safe
folder name to create .msf file and the msg file (ie, 'aa.msg' and 'aa'). The
string passed to NS_MsgHashAutoStringIfNecessary() is the one entered by the
users (ie, no conversion is performed on it) and for this reason
nsMsgI18Ncheck_data_in_charset_range() returns TRUE because Chinese string is
supported by Chinese windows. At this point we have created .msf and msg files
on disk. So far so good.
2. Then in nsMsgLocalMailFolder::CreateSubfolder() we call AddSubfolder() which
eventually calls NS_MsgCreatePathStringFromFolderURI(). The latter does some
string manipulations and calls NS_MsgHashIfNecessary().
NS_MsgHashIfNecessary() then converts the input C string to nsAUtoString before
calling NS_MsgHashAutoStringIfNecessary(). So by the time we try to check if the
folder name will convert to the underlying OS the string is altered and the call
to nsMsgI18Ncheck_data_in_charset_range()fails! Since the call fails the name
is hashed and all the subsequent calls to open the folder database fails as
well. This is because in step one we create the .msf file with the original name
the users entered and now we try to open the database with a different (hashed)
name. The problem is really that the string passed to
NS_MsgHashAutoStringIfNecessary() (called by NS_MsgHashIfNecessary()) does not
represent a correct Chinese string.
To fix the problem we need to make NS_MsgCreatePathStringFromFolderURI() call
NS_MsgHashAutoStringIfNecessary() directly (instead of NS_MsgHashIfNecessary()).
But then we need to change NS_MsgCreatePathStringFromFolderURI() to use
nsAutoString instead of nsCAutoSting.
Commenting out the call to nsMsgI18Ncheck_data_in_charset_range(), the patch
works for the following (tested) cases of folder creation:
1. ASCII folders in English windows.
2. Chiness folders in Chiness windows.
However, with the call to nsMsgI18Ncheck_data_in_charset_range() it does not
work for the following cases of folder creation:
1. Chiness folders in English windows.
2. Chiness folders in Chiness windows.
OK, here are the reasons why: older:: CreateSubfolder () we call tringIfNecessar y() directly to make sure that we have a safe tringIfNecessar y() is the one entered by the data_in_ charset_ range() returns TRUE because Chinese string is
1. In nsMsgLocalMailF
NS_MsgHashAutoS
folder name to create .msf file and the msg file (ie, 'aa.msg' and 'aa'). The
string passed to NS_MsgHashAutoS
users (ie, no conversion is performed on it) and for this reason
nsMsgI18Ncheck_
supported by Chinese windows. At this point we have created .msf and msg files
on disk. So far so good.
2. Then in nsMsgLocalMailF older:: CreateSubfolder () we call AddSubfolder() which hStringFromFold erURI() . The latter does some essary( ). essary( ) then converts the input C string to nsAUtoString before tringIfNecessar y(). So by the time we try to check if the data_in_ charset_ range() fails! Since the call fails the name tringIfNecessar y() (called by NS_MsgHashIfNec essary( )) does not
eventually calls NS_MsgCreatePat
string manipulations and calls NS_MsgHashIfNec
NS_MsgHashIfNec
calling NS_MsgHashAutoS
folder name will convert to the underlying OS the string is altered and the call
to nsMsgI18Ncheck_
is hashed and all the subsequent calls to open the folder database fails as
well. This is because in step one we create the .msf file with the original name
the users entered and now we try to open the database with a different (hashed)
name. The problem is really that the string passed to
NS_MsgHashAutoS
represent a correct Chinese string.
To fix the problem we need to make NS_MsgCreatePat hStringFromFold erURI() call tringIfNecessar y() directly (instead of NS_MsgHashIfNec essary( )). hStringFromFold erURI() to use
NS_MsgHashAutoS
But then we need to change NS_MsgCreatePat
nsAutoString instead of nsCAutoSting.
Commenting out the call to nsMsgI18Ncheck_ data_in_ charset_ range() , the patch
works for the following (tested) cases of folder creation:
1. ASCII folders in English windows.
2. Chiness folders in Chiness windows.
However, with the call to nsMsgI18Ncheck_ data_in_ charset_ range() it does not
work for the following cases of folder creation:
1. Chiness folders in English windows.
2. Chiness folders in Chiness windows.