Closed Bug 13952 Opened 21 years ago Closed 20 years ago

The escape sequences unicode in wallet.properties can't display correctly

Categories

(SeaMonkey :: General, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rchen, Assigned: morse)

References

Details

The escape sequences unicode in wallet.properties can't display correctly.

I put the string \u30d5\u30a1\u30a4\u30eb which is "File" in Japanese to
firstPassword in wallet.properties. When I ran apprunner and go to
edit/wallet/select/Safe From Fill, the dialog shows .... for these characters.
This test was on 09/15/99 build on Japanese NT.
Blocks: 12394
QA Contact: leger → rchen
Reassign QA to myself.
Assignee: saari → morse
This is in the wallet area. Reassign to morse first. Morse, please contact
either tao or rchen for help. Thanks
Status: NEW → ASSIGNED
Target Milestone: M14
Tao or rchen, HELP.  What do I do here?  How can I reproduce this?  How do I fix
it?
Hi Steve, can you point out where the code is (file and function)? I would like
to take a look at the code and see if I can fix it.
wallet.properties is in extensions/wallet/src.  The code that reads that
properties file is in extensions/wallet/src/wallet.cpp.  The way to trigger it
is to select the menu item of edit/wallet/display-wallet-contents.  The function
in wallet.cpp is Wallet_SetKey.
I take a look at the code and here is my finding...
1. The function declaration
PUBLIC char*
Wallet_Localize(char* genericString) {
is BAD BAD. Change it to PUBLIC PRUnichar* . char* is not good for non ASCII
data.

2. The implementation of Wallet_Localize seems ok untill
714   ret = bundle->GetStringFromName(ptrtmp, &ptrv);
this line is probably ok.But the next line is bad
724   return v.ToNewCString();

The ToNewCSting function will damage the unicode data and you should not use it,
instead, you should return thr PRUnichar* by calling GetUnicode().

You should not use char* as your data type, which is BAD BAD. You should use
PRUnichar* as your data type as possible as you can. And you will find most of
the Gecko API use PRUnichar* but not char*.

ToNewCString will damage data. Don't use it!!!!
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Now fixed in wallet, single signon, and cookies.
Status: RESOLVED → VERIFIED
verified
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.