Windows registry (non-ascii values) for MAPI are garbled

RESOLVED FIXED

Status

MailNews Core
Simple MAPI
RESOLVED FIXED
13 years ago
9 years ago

People

(Reporter: Jungshik Shin, Assigned: Jungshik Shin)

Tracking

({intl})

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-aviary1.0)

Attachments

(4 attachments, 1 obsolete attachment)

(Assignee)

Description

13 years ago
Spin-off of bug 232969.

In bug 232969, I fixed a problem with storing non-ASCII string values in Win
registries. A similr problem exists at

http://lxr.mozilla.org/mozilla/source/mailnews/mapi/mapihook/src/nsMapiRegistryUtils.cpp#148
(Assignee)

Comment 1

13 years ago
Issac, is this bug identical in its nature to bug 232969? That is, I'm wondering
if we're pretending UTF-8 strings are in the system code page (e.g. Windows-949
on Korean windows) and putting UTF-8 strings in Windows registries. If that's
the case, I'll make a quick patch that works for characters within the
repertoire of the current system locale. I can deal with characters not covered
by the current system code page later (after resolving bug 239279)
Status: NEW → ASSIGNED
Depends on: 239279

Comment 2

13 years ago
> is this bug identical in its nature to bug 232969?

Yes. On WinXP, raw UTF-8 string is put into registry, although the Win-registry
engine parses it as USC2. I'll attach a screenshot demonstrating this. On Win9x,
I guess it would be saved in the locale-specific system code page.

Comment 3

13 years ago
Created attachment 151683 [details]
Garbled Text

If |defaultMailDisplayTitle| in messenger-mapi/mapi.properties are localized to
"%S 메일", the application string in Start Menu is garbled. The same garbled
text appears in various places, such as Control Panel/Internet
Options/Programs.
(Assignee)

Comment 4

13 years ago
(In reply to comment #2)
> Yes. On WinXP, raw UTF-8 string is put into registry, although the Win-registry
> engine parses it as USC2. I'll attach a screenshot demonstrating this. 
> On Win9x,
> I guess it would be saved in the locale-specific system code page.

Thanks for the confirmation. On both Win 2k/XP and Win 9x/ME, UTF-8 strings are
 put into registries with 'A' APIs which expect strings in the locale code page
instead of UTF-8. So, this bug is of exactly the same nature as bug 232969 and
bug 240272. 

I'll make an _interim_ patch that will make Mozilla handle characters covered by
the locale code page correctly. It's possible to branch the code into two, Win
9x/ME and Win 2k/XP based on the run time detection of the OS to take full
advantage of Unicode support on Win 2k/xp, but I'd rather not do it that way.
Once bug 239279 is resolved, it should be easy enough to make use of Win2k/XP's
Unicode capability. 
(Assignee)

Comment 5

13 years ago
Created attachment 151687 [details] [diff] [review]
patch (not yet tested)

Patch. if you can test it, it'd be great. Otherwise, i'll test it later.
(Assignee)

Comment 6

13 years ago
Created attachment 151739 [details] [diff] [review]
patch update

This should do.
Attachment #151687 - Attachment is obsolete: true

Comment 7

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

I tested the patch on WinXP, and it worked great. Thanks.
(Assignee)

Comment 8

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

thanks for testing.
asking for r/sr.
Attachment #151739 - Flags: superreview?(mscott)
Attachment #151739 - Flags: review?(bienvenu)

Comment 9

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

thx for doing this.
Attachment #151739 - Flags: review?(bienvenu) → review+
(Assignee)

Comment 10

13 years ago
This is rather a trivial fix with a low risk factor that I think should go in
for aviary-1.0 bracn and 1.7 branch as well as the trunk.
Flags: blocking1.8a2?
Flags: blocking1.7.1?
Flags: blocking-aviary1.0RC1?
Flags: blocking-aviary1.0?
(Assignee)

Comment 11

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

asking Neil for sr
Attachment #151739 - Flags: superreview?(mscott) → superreview?(neil.parkwaycc.co.uk)

Comment 12

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

Presumably these conversions can be removed once we have the aforementioned
unicode api handling the conversions that 95/98/Me require.
Attachment #151739 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
(Assignee)

Comment 13

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

thansk for r/sr
asking for a1.7

this is a rather trivial fix that makes Mozilla properly deal with non-ASCII
values in Windows registry until we convert Mozilla-Win to be
fully-Unicode-capable (when we can get rid of the conversion and use
Unicode/'W' APIs directly). Similar patches for other parts of Mozilla already
have been checked in to 1.7branch.  

Affected users: Users of localized versions of Mozilla-Win
Attachment #151739 - Flags: approval1.7.1?

Comment 14

13 years ago
Created attachment 152485 [details] [diff] [review]
thunderbird 1.0 branch fix

the thunderbird 1.0 branch uses a very different looking
nsMapiRegistryUtils.cpp. I tried to re-write this patch by hand. Hopefully I
didn't make any mistakes or mis any of the new patterns :)

Updated

13 years ago
Whiteboard: fixed-aviary1.0
(Assignee)

Comment 15

13 years ago
Created attachment 152496 [details] [diff] [review]
additional patch for aviary-1.0 branch

thanks for review and fixing it on TB 1.0 branch. I didn't expect the branch to
be that much different from seamonkey 1.7 branch. anyway, here are a few more
changes missed in the latest check-in (attachment 152485 [details] [diff] [review]). 

I haven't yet tested (haven't even compiled on Windows) this patch. I'm not
sure I have sufficient disk space on my Windows box for yet another build and
source tree.

Comment 16

13 years ago
Comment on attachment 151739 [details] [diff] [review]
patch update

a=mkaply
Attachment #151739 - Flags: approval1.7.1? → approval1.7.1+

Comment 17

13 years ago
attachment 152496 [details] [diff] [review] now checked into the aviary 1.0 branch as well. Thanks for the
supplemental patch jshin. I added a missing semi colon to make it compile. 
(Assignee)

Comment 18

13 years ago
thansk for a1.7. checked into 1.7branch.

I changed my mind and am resolving this bug as fixed (to avoid unnecessarily
blocking 1.7* and aviary 1.0*).  I'll file a new bug  about switching over to W
APIs for registry handling once bug 239279 is resolved. 
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
No longer depends on: 239279
Resolution: --- → FIXED

Updated

13 years ago
Flags: blocking1.8a2?
Flags: blocking1.7.1?
Flags: blocking-aviary1.0RC1?
Flags: blocking-aviary1.0?
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.