Closed
Bug 24010
Opened 25 years ago
Closed 25 years ago
feature: text/plain from an external app is restricted to ISO-8859-1
Categories
(Core :: Internationalization, defect, P1)
Core
Internationalization
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: nhottanscp, Assigned: mikepinkerton)
References
Details
(Whiteboard: [PDT+])
This is a cross platform problem where text/unicode is not available (e.g. Win98). Here is a reproducable case using MacOS. 1) Using simple text, type accent characters (e.g. option + '`' + a) or use the KeyCaps. 2) Select the string and copy. 3) Paste to mozilla text area. The original string not pasted, garbage instead.
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Summary: Conversion from text/plain to XIF is restricted to ISO-8859-1 → text/plain from an external app is restricted to ISO-8859-1
Target Milestone: M14
Assignee | ||
Comment 1•25 years ago
|
||
accepting for m14, changing summary to remove mention of xif (we don't use it on importing text to ender)
Assignee | ||
Updated•25 years ago
|
Summary: text/plain from an external app is restricted to ISO-8859-1 → feature: text/plain from an external app is restricted to ISO-8859-1
Assignee | ||
Comment 2•25 years ago
|
||
marking as a feature, this is additional work.
Assignee | ||
Comment 3•25 years ago
|
||
what is the correct way to handle this? we're not actually parsing any text in this case so I don't want to run it through the parser with the correct charset like we did in the case of exporting text to the OS. Are there any mechanisms I can use?
Reporter | ||
Comment 4•25 years ago
|
||
What we need is to convert from the platform charset to unicode. If the unicode conversion is not done in the clipboard code (for text/plain) then the conversion to be done by the caller (e.g. editor) instead.
Assignee | ||
Comment 5•25 years ago
|
||
right. my question is how we can do this. I'm not familiar with what converters/ mechanisms are at my disposal ;)
Reporter | ||
Comment 6•25 years ago
|
||
How about changing nsISupportsString by adding toWString? There, it can convert from the platform charset to unicode. So the editor can call toWString instead of toString.
Assignee | ||
Comment 8•25 years ago
|
||
that would make sense, I guess my main question is how would i convert it to a unichar string? would i have to run it through a parser or would it be enough to just assign it into a unicode (nsString) string?
Reporter | ||
Comment 9•25 years ago
|
||
The input string (in platform charset) needs to be converted to unicode explicitly. The conversion to unicode is done by nsIUnicodeDecoder. There are many examples in the current code for the usage also in the header file (nsIUnicodeDecoder.h). // get the charset manager NS_WITH_SERVICE(nsICharsetConverterManager, ccm, kCharsetConverterManagerCID, &rv); // get the encoder (may want to cache this) rv = ccm->GetUnicodeDecoder(&fileSystemCharset, &mUnicodeEncoder); // estimate out length rv = mUnicodeDecoder->GetMaxLength(inString, inLength, &outLength); // allocate out buffer // convert rv = mUnicodeDecoder->Convert(inString, &inLength, outString, &outLength);
Assignee | ||
Comment 10•25 years ago
|
||
awesome, that's exactly what i was looking for ;) thanks!
Assignee | ||
Comment 13•25 years ago
|
||
fixes in on all 3 platforms.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 14•25 years ago
|
||
I tested this in 2000020410 Win32, Mac build, and 2000020408 Linux build.
Status: RESOLVED → VERIFIED
Comment 15•23 years ago
|
||
Should this bug be reopened again, or is it the same bug as Bug 10816 (about support for UTXT on the Mac clipboard) and thus being fixed by the UTXT-patch from nhotta. ? Because, as I mentioned when I filed Bug 79864: if yo try to import e.g. cyrillic text via the clipboard from external app, it will be pasted into Mozilla as meaningless "ISO-8859-1" instead.
Reporter | ||
Comment 16•23 years ago
|
||
This bug is for adding charset conversion to support to clipboard so non Latin1 characters can be supported. This is fixed. The conversion is dependent to OS charset but that is a separate issue from this bug. Bug 10816 addresses that issue by supporting unicode clipboard, or in case related issues (of text/plain) not covered by but 10816 please file a separate bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•