Re: please apply this patch - fix for CJK printing


Subject: Re: please apply this patch - fix for CJK printing
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Tue Dec 12 2000 - 11:46:22 CST


CJK (possibly Big5 too) printing fix from Vlad. Fixes bug reported by
Chih-Wei Huang.

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: xap_UnixPSGraphics.cpp
CVS: ----------------------------------------------------------------------

>From: Vlad Harchev <hvv@hippo.ru>
>To: abiword-dev@abisource.com
>Subject: please apply this patch - fix for CJK printing
>Date: Tue, 12 Dec 2000 15:48:45 +0400 (SAMT)
>
>
> Chih-Wei Huang has found yet another bug of the "non-quoting bytes of
>multibyte sequence" kind - this time in printing (thanks!). Analysis showed
>that there are no bugs of this kind remaining in AW for Big5 encoding, but
>HTML exporter my have ones for the encodings for which bytes of multibyte
>sequence can be '<', '>', '&' (big5 is not affected). So some one may come
>with a similiar patch for HTML exporter.
>
> This is CJK-specific bug (or may be even more, Big5-specific - I don't
>know).
>
>
> Best regards,
> -Vlad
>
>--- xap_UnixPSGraphics.cpp-old Tue Dec 12 12:31:04 2000
>+++ xap_UnixPSGraphics.cpp Tue Dec 12 12:34:27 2000
>@@ -406,8 +406,16 @@
> m_ps->writeBytes(buf);
> pD = buf;
> }
>- for(int i=0;i<_bytes_len;++i)
>- *pD++ = _bytes[i];
>+ for(int i=0;i<_bytes_len;++i) {
>+ char c = _bytes[i];
>+ switch (c)
>+ {
>+ case '\\': *pD++ = '\\'; *pD++ = '\\'; break;
>+ case '(': *pD++ = '\\'; *pD++ = '('; break;
>+ case ')': *pD++ = '\\'; *pD++ = ')'; break;
>+ default: *pD++ = (unsigned char)c; break;
>+ }
>+ };
> } else {
> currentChar = remapGlyph(*pS, *pS >= 256 ? UT_TRUE : UT_FALSE);
> currentChar = currentChar <= 0xff ? currentChar :
>XAP_EncodingManager::instance->UToNative(currentChar);
>
>

_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com



This archive was generated by hypermail 2b25 : Tue Dec 12 2000 - 11:46:26 CST