Closed Bug 251896 Opened 21 years ago Closed 8 years ago

incorrect inflation of system code page strings to UTF-16 in msgMapiHook.cpp

Categories

(MailNews Core :: Simple MAPI, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jshin1987, Assigned: smontagu)

References

Details

(Keywords: intl)

Attachments

(1 file)

mailnews/mapi/mapihook/src/msgMapiHook.cpp has a number of incorrect inflations of strings in the system code page to UTF-16 with 'Assign/AppendWithConversion'. This will only work for strings in ISO-8859-1. It doesn't even work for the C0 part (0x80 - 0x9f) of Windows 1252 on English/Western European windows. They all should use |NS_CopyNativeToUnicode|. BTW, when bug 239279 is fixed, we need to change all MAPI code to use 'W' APIs, for which I'll file a separate bug.
> |NS_CopyNativeToUnicode|. strictly speaking, this is only guaranteed to work for filenames... http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsNativeCharsetUtils.h#48
and that's what the code was doing before, as near as I can tell - trying to use the file system charset, which didn't work at all for my test case.
(In reply to comment #1) > > |NS_CopyNativeToUnicode|. > > strictly speaking, this is only guaranteed to work for filenames... > http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsNativeCharsetUtils.h#48 I guess you'd agree :-) that 'filenames' in the comment can be (loosely) interpreted as C strings that come out_of Win32 'A' APIs (at least for the now).
Status: NEW → ASSIGNED
David, can you tell me how to test MAPI? I replaced all 'WithConversion's with 'NS_CopyNativeToUnicode' assuming that they can have non-ASCII characters in the system default encoding. It seems that 'To', 'Cc', 'From' etc include 'names' as well as addresses so that they can have non-ASCII characters.
*** Bug 250481 has been marked as a duplicate of this bug. ***
one way to test mapi is to build and run the mapi test app, mailnews/mapi/old/tests/mapitest - open the project in visual studio and build and run it (after first setting tbird/mozilla to be the default mail client)
Product: MailNews → Core
Assignee: jshin1987 → smontagu
Status: ASSIGNED → NEW
QA Contact: simple-mapi
Product: Core → MailNews Core
The thing used now is Append(NS_ConvertASCIItoUTF16()) https://hg.mozilla.org/comm-central/file/tip/mailnews/mapi/mapihook/src/msgMapiHook.cpp So the original proposal does not apply anymore. Closing as WONTFIX for lack of better status.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: