Re: urmaslt - r29620 - abiword/trunk/plugins/mswrite/xp

From: Ingo Brückl <ib_at_wupperonline.de>
Date: Sat Jul 16 2011 - 12:26:38 CEST

eskaer_spamsink@ngs.ru wrote on Sat, 16 Jul 2011 05:59:08 +0700:

> - Some documents [mostly from Windows NT 3] are in local codepage, but
> use plain font names, as 'Times New Roman' instead of tagged 'Times New
> Roman Cyr'. So it's safe to assume that if document has untagged name,
> but no tagged, that font has local encoding instead of CP1252.

No it isn't!

I had some problems with the codepage patch from the very beginning, because
there is no such thing as a codepage information in MSWrite files! (See the
Microsoft font documentation.) CP1252 is default unless a font substitute is
used. It may be true that there are documents in "Windows local codepage"
without font substitute, but this is just the usual Windows crap. When such
documents are shared between two users with different locales, then the same
thing happens as it did in Windows all the time: The contents created on one
computer is unreadable on the other one unless the encoding is explicitly
changed. So either we stick to the Microsoft documentation or we create a
special, individual solution for some (or one?) of us.

As I mentioned in the original codepage thread, the only reasonable solution
would be to have either a compile time parameter for the default codepage
(should be fairly easy to do: something like --with-mswrite-codepage= with
default CP1252, leading to something like -DDEFAULT_CODEPAGE=\"CP1252\" in
the Makefile and a simple source change):

  --- a/plugins/mswrite/xp/ie_imp_MSWrite.cpp
  +++ b/plugins/mswrite/xp/ie_imp_MSWrite.cpp
  @@ -293,7 +293,7 @@ static struct cst_data {
          {"\x09 (Hebrew)", "CP1255"},
          {"\x09 (Arabic)", "CP1256"},
          {"\x07 Baltic", "CP1257"},
  - {NULL, "CP1252"} // default codepage
  + {NULL, DEFAULT_CODEPAGE}
   };

   inline void IE_Imp_MSWrite::translate_char (char ch, UT_UCS4String &buf)

or - preferable - a configuration dialog in AbiWord to set the favored
default codepage for the plugin so that it can be changed on a document
basis. But such a configuration dialog in AbiWord is beyond my scope of both
programming skill and time and probably don't worth the effort.

This was all discussed already a year ago when the codepage patch was
suggested, but nobody cared.

> - If there's an authentic Write document, using codepage different from
> 1252, 1251 or 1250, with corresponding standard font typefaces, we can
> include additional tags in the list, but no sooner.

Well, it seems that you are less interested in general support according to
Microsoft rules than in some personal benefit. And BTW, did you do the major
work in this plugin so that you can claim to decide what shall go into the
plugin and what not?

Ingo
Received on Sat Jul 16 13:49:10 2011

This archive was generated by hypermail 2.1.8 : Sat Jul 16 2011 - 13:49:10 CEST