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 <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>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


Reply via email to