bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange string character conversion


From: Yen-Ju Chen
Subject: Re: Strange string character conversion
Date: Mon, 09 Sep 2002 10:47:31 -0400

 I have some comments from my experience.
 Hope it help.

 I think base/Unicode.m should work.
 Most problem could be in gui/back rather than base.
 I would suggest you to try backart instead
 to minimize the problem with font cache.
 It's really painful to pick up the right font in x11/xlib backend.

 The Localizable.strings is not a property list (I think),
 and actually you don't need to convert it into unicode.
 (Maybe it is encouraged to do so, but I never. :)
 Simply set up the GNUSTEP_STRING_ENCODING and right fonts,
 and it should works, if you backend pick up the right font.

 If you really want to do the dubug,
 I did something before.
 Check the encoding conversion in gnustep-base.
Write an application in text-mode using Localizable.strings for some NSString, like _(@"string");
 Use getCharacters: to dump the string with internal unicode encoding
 into a unichar buffer, and printf the buffer out.
(you need to convert unichar into char first).
 The printf-out should be in unicode encoding,
 and use the program, iconv, to convert it back into your local encoding
 to see whether the internal unicode is correct.
 The internal unicode should be UCS-2 or UCS-2-INTERNAL (I forgot).

 For x11/xlib, look into the XftFontInfo.m in backend/Source/xlib/.
 (For GSFontAntiAlias = YES only)
 In setupAttributes method,
NSLog out the xfontname, and use XftPatternPrint() to print out the pattern.
 Compare the xfontname and the print-out pattern.
 Check the name and encoding to see whether the encoding matches.

 For input, if you use any XIM-server,
 in backend/Source/x11/XIMInputServer.m,
 dump the result of input in lookupStringForEvent:window:keysym:.
 This part should be easy.

 Yen-Ju

From: Stefan Urbanek <urbanek@host.sk>
To: bug-gnustep@gnu.org
Subject: Strange string character conversion
Date: Mon, 09 Sep 2002 09:18:20 +0100

Hi,

While translating an application I have noticed strange behaviour of string encoding conversion. At first, I thought it was just a font problem, but it seems not. To convert a localizable file I use:

cvtenc -Encoding "ISO Latin-2 East European (ISO-8859-2)"\ -EscapeIn NO -EscapeOut YES \ Localizable.latin-2.strings > Localizable.strings

I have used GSFontMask *-iso8859-2 for font_cacher and also GNUSTEP_STRING_ENCODING=NSISOLatin2 (without this env. variable I get an exception). Characters were still not displayed properely. I have tried to open some window with a text view and typed some text there with some Latin2 characters. They were displayed as those from the localizable file. BUT: when i have selected them and copied, then pasted them into some another non-gnustep X application they were same as in gnustep-app, not as I have typed. They has been converted as I was typing.
Example:
- typed character or character from file 'c' (small c) with caron in gnustep app is displayed as 'C' with caron - when selected that typed-small-'c'-but-displayed-as-capital-c and pasted in another app, it is pasted as capital 'C' with caron - when selected small 'c' with caron in an X app and pasted in gnustep-app it is displayed as capital 'C' with caron.

The C character was just taken as an example, it is the same with another characters (for example 'capital N with caron'->'small n with accent', 'capital U with accent' -> 'multiply sign x'...)

I thought that the problem was in base/Unicode.m, but it seems not (i have tested conversions between NSData and NSString).

Any hints?

Thank you,

Stefan



_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnustep




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]