discuss-gnustep
[Top][All Lists]
Advanced

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

Re: ANN: GUI-0.11.0


From: Wolfgang Lux
Subject: Re: ANN: GUI-0.11.0
Date: Wed, 30 Aug 2006 18:56:50 +0200

Charles Philip Chan wrote:

On 2006-08-30 05:06:17 -0400 Andreas Höschler <ahoesch@smartsoft.de> wrote:

If I open it on GNustep with TextEdit.app the german letters are gone. If I create a file under GNUstep and open it on a Mac (TextEdit.app), the german
characters are replaced with garbage!?

After looking at the attached rtf and doing some research, it looks like the encoding is "Mac OS Roman" (cpg1000):

        http://en.wikipedia.org/wiki/Code_page_10000

and not unicode.

Right. And since Windows copepage 1252 is close to ISO 8859-1 (and thus the first 256 characters of Unicode, the following simple patch will make GNUstep
write RTF files that -- at least as far as ISO 8859-1 characters are
concerned -- are read correctly by OS X's TextEdit.app.

--- TextConverters/RTF/RTFProducer.m.orig 2006-08-30 17:59:51.000000000 +0200
+++ TextConverters/RTF/RTFProducer.m    2006-08-30 18:00:29.000000000 +0200
@@ -395,7 +395,7 @@
// grok paragraph spacing \saN. Should be no problem with other RTF parsers // as this command will be ignored. So this is for compatibility with OS X.
   result = (NSMutableString *)[NSMutableString stringWithString:
-      @"{\\rtf1\\ansi\\ansicpg10000\\cocoartf102"];
+      @"{\\rtf1\\ansi\\ansicpg1252\\cocoartf102"];

   [result appendString: [self fontTable]];
   [result appendString: [self colorTable]];

The patch on the input side is more complicated, as it requires reading the code page from the RTF file (which according to my cursory look is currently ignored in the RTF parser) and setting up an appropriate iconv translation in RTFConsumer.m (which is currently both beyond my time and iconv expertise).

Wolfgang






reply via email to

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