Subject: Re: request for help from CJK hackers
From: Vlad Harchev (hvv@hippo.ru)
Date: Thu Nov 09 2000 - 04:24:17 CST
On Thu, 9 Nov 2000, Vlad Harchev wrote:
> On Thu, 9 Nov 2000, Belcon Zhao wrote:
> 
>  Hello Belcon,
> 
>  It seems I found a solution to the problem. It's my silly bug in RTF
> exporter. I'm very sorry for it. (Though I don't have CJK locale to test
> solution). In ie_exp_RTF_listenerWriteDoc.cpp, in function 
> s_RTF_ListenerWriteDoc::_outputData there are following strings:
>                                 if (c>0x007f) {
>                                         m_pie->_rtf_keyword("uc",0);
>                                         signed short si = *((signed short *)c);
>                                         m_pie->_rtf_keyword("u",si);
> 
>                                 } else {
>                                         *pBuf++ = (UT_Byte)c;
>                                 };
>  They should be changed to:
>                                 if (c>0x007f) {
> 					FlushBuffer();
>                                         m_pie->_rtf_keyword("uc",0);
>                                         signed short si = *((signed short*)c);
>                                         m_pie->_rtf_keyword("u",si);
> 
>                                 } else {
>                                         *pBuf++ = (UT_Byte)c;
>                                 };
> I.e. FlushBuffer(); inserted. 
> Please report whether this solves the problem.
>  If yes, then it seems AW is fully CJK-aware. 
 Ups, my file was screwed up - that piece is absent in CVS (and it's OK -
don't commit that branch.)
 Current file has
                       m_wctomb.wctomb_or_fallback(mbbuf,mblen,*pData++);
                       for(int i=0;i<mblen;++i) {
                               unsigned char c = mbbuf[i];
                               if ( c > 0x007f)
                                       m_pie->_rtf_nonascii_hex2(c);
                               else
                                       *pBuf++ = c;
                       };
 Should be changed to
                       m_wctomb.wctomb_or_fallback(mbbuf,mblen,*pData++);
                       for(int i=0;i<mblen;++i) {
                               unsigned char c = mbbuf[i];
                               if ( c > 0x007f) {
                                       FlushBuffer();	
                                       m_pie->_rtf_nonascii_hex2(c);
                               } else
                                       *pBuf++ = c;
                       };
 I.e. FlushBuffer(); inserted again.
 I'm sorry for confusion.
 Best regards,
  -Vlad
This archive was generated by hypermail 2b25 : Thu Nov 09 2000 - 04:43:35 CST