On Fri, 3 Nov 2000, Belcon Zhao wrote:

> Hello
> Vlad Harchev ���
> >
> >On Fri, 3 Nov 2000, Belcon wrote:
> >
> >  Hello Belcon,
> >
> > > After I apply Vlad's i18n patch(whose name is abi-oct24.patch),cjk.patch
> > > and next-cjk-patch.diff
> > > on clean AbiWord 0.7.11,I still found that AbiWord can't work with RTF
> > > format file normally.
> > > And so,we can't copy&paste CJK characters in AW,read and show CJK
> > > characters correctly.
> >
> >  What do you mean by 'read & show'?
> >
> 
> Sorry for my poor english.Here,I mean AW import Chinese RTF file and
> show the characters on screen correctly.

 OK.
 I've attached a patch to ie_exp_RTF*.cpp that should make RTFs produced by AW
successfully importable into it (so cut&paste will work fine) though old Words
won't understand those RTFs.
 Could you try it and report results?
 
> >  Have your tried the most recent patch by me that was making use of
> >gdk_fontset_load() instead of gdk_font_load() in gr_UnixGraphics.cpp?
> >
> 
> Yes,sure.I have found the way to deal with this bug.That is my ugly
> patch!
> :-(

 That's very strange. This should be traced. May be this will work only on
Modern XFree's or Xlibs only?
 
> >[...]
> > > BTW: It seemed that current AW CVS version hadn't apply all CJK patch
> > >      of Vlad.After I install it,it even can't show CJK characters in
> > >      menu and toolbar.:-(
> >
> >  Wow! I didn't expect this..
> >  I will check it 8 hours later.
> 
> Sorry.After I update my abi CVS version.It work fine!Sorry again!

 Very nice to hear that. So I will check it much later then :)

> > [..]
> >  So please try adding "else return UT_TRUE;" there and report results with
> >  only this modification (without fix you've proposed).
> >
> 
> I am not familiar with AW.But when I tried to do as what you said,AW
> come accross with same problem as not be fixed befor.:-(
> I will debug next Monday!

 OK. This definitely needs tracing. Something wrong with something. I repeat, 
that code works fine with russian (text data in RTF is in other charset).

>[...]

 Best regards,
  -Vlad
--- ie_exp_RTF_listenerWriteDoc.cpp-was Wed Nov  1 10:13:10 2000
+++ ie_exp_RTF_listenerWriteDoc.cpp     Wed Nov  1 10:17:48 2000
@@ -194,6 +194,7 @@
                default:
                        if (XAP_EncodingManager::instance->cjk_locale())
                        {
+#if 0                  
                                /*FIXME: can it happen that wctomb will fail under CJK 
locales? */
                                m_wctomb.wctomb_or_fallback(mbbuf,mblen,*pData++);
                                for(int i=0;i<mblen;++i) {
@@ -204,6 +205,17 @@
                                                *pBuf++ = c;
                                        
                                };
+#else
+                               UT_UCSChar c = *pData++;
+                               if (c>0x007f) {
+                                       m_pie->_rtf_keyword("uc",0);
+                                       signed short si = *((signed short *)c);        
+ // so we need to write negative
+                                       m_pie->_rtf_keyword("u",si);                   
+                 // numbers for large unicode values.
+                                                                               
+                               } else {
+                                       *pBuf++ = (UT_Byte)c;
+                               };
+#endif                         
                        } else if (!m_pie->m_atticFormat) 
                        {
                                if (*pData > 0x00ff)            // emit unicode 
character

Reply via email to