Closed
Bug 60823
Opened 24 years ago
Closed 24 years ago
UnicodeToGBK and UnicodeToGB2312 converter don't work on SPARC Solaris
Categories
(Core :: Internationalization, defect, P1)
Tracking
()
VERIFIED
FIXED
People
(Reporter: masaki.katakai, Assigned: shanjian)
References
Details
(Keywords: intl)
Attachments
(3 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
nsUnicodeToGBK.cpp and nsUnicodeToGB2312V2.cpp don't work
for ASCII characters on SPARC Solaris. Please try the following,
./nsconv -f utf-8 -t x-gbk
When you type ascii characters, but it doesn't return.
On SPARC Solaris platform, Mozilla could not create
new profile under user's home directory in zh.GBK locale
but created MOZILLA_HOME/default_prefs.js.
After debugging, I found NS_NewUnicodeLocalFile() in zh.GBK locale.
This will convert UNICODE to native encoding. The target
string is very simple, e.g. "/home/katakai/.mozilla" but
it fails and returns "".
It seems that nsUnicodeToGBK.cpp and nsUnicodeToGB2312V2.cpp
uses leftbyte when the input is ASCII, but it doesn't work
on SPARC platform.
I'll attach the simple patch for this problem. Please evaluate.
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Katakai san, I assign this to you since you have a patch, cc to erik, bstell.
Assignee: nhotta → katakai
Comment 3•24 years ago
|
||
The fix is correct, but I would prefer the following:
*aDest++ = *pSrc;
r=erik
Reporter | ||
Comment 4•24 years ago
|
||
Hotta-san, can you check-in this change for me?
I've requested CVS access but I could not get yet.
Comment 5•24 years ago
|
||
Please get a super review then I can check in.
http://www.mozilla.org/hacking/reviewers.html
Hi, Masaki-san:
Please resubmit a patch w/ Erik's suggestion and get a review from cata and
super-review from Erik.
thx
Reporter | ||
Comment 7•24 years ago
|
||
Comment 9•24 years ago
|
||
sr=erik
Comment 10•24 years ago
|
||
Why *aDest = pSrcDBCode->leftbyte; does not work on SPARC?
Comment 11•24 years ago
|
||
SPARC is big-endian, while Intel is little-endian. The data is in little-endian
double-byte Unicode (shorts), but the code is applying a struct that has
leftbyte first, so it doesn't work.
Comment 12•24 years ago
|
||
Sorry, what I meant to say, was: The data is in little-endian Unicode only on
Intel, so the struct with leftbyte will work there, but the data is big-endian
on SPARC, so the struct does not work there.
Assignee | ||
Comment 13•24 years ago
|
||
I found the same problem on HP (bug 61466). I will mark 61466 as a duplicated one.
Katakai, please use type cast before assignment, that will avoid some compiler
warning. ie. *aDest++ = (char)*pSrc;
If you can check it into trunk, please do it. Otherwise reassign it to me.
thanks!
Comment 14•24 years ago
|
||
r=nhotta, please include shanjian's comment
Reporter | ||
Comment 15•24 years ago
|
||
Reporter | ||
Comment 16•24 years ago
|
||
I couldn't still get a permission for check-in. Reassign to Shanjian.
Assignee: katakai → shanjian
Assignee | ||
Comment 17•24 years ago
|
||
*** Bug 61466 has been marked as a duplicate of this bug. ***
Comment 18•24 years ago
|
||
Hi, Katakai-san:
We got r=nhotta & sr=erik for the proposed patch. Is there anything else
to be done?
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 19•24 years ago
|
||
Fix has been checked in to trunk and OEM branch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 20•24 years ago
|
||
integrated into OEM branch. Tao, Shanjian, thank you very much for your help.
Reporter | ||
Comment 22•24 years ago
|
||
Verified fix on the latest build on Solaris SPARC.
Status: RESOLVED → VERIFIED
Comment 23•24 years ago
|
||
Adding intl and nsbeta1 keywords.
Adding mcarlson to cc-list.
You need to log in
before you can comment on or make changes to this bug.
Description
•