wv was really terribly broken for word6 format files. Here is a patch that
fixes this.

 To CJK guys:

* Now word6.doc from _Belcon_ gets imported properly too (and word2k document
  from Chih-Wei Huang also OK)

* word6.doc from Chih-Wei Huang's mail I've forwarded here doesn't import
  properly -  (chars are not converted to unicode) since wv thinks it's in 
  word7 format (!) - wvQuerySupported(&ps->fib,NULL) returns WORD7, so it 
  seems there is no clean workaround/hack for importing it (may be wordpad is 
  that broken - is word able to read this file ? And what version of windows
  wordpad is used from -  is it from win2k or from NT or from win9x?). 
  IMO the only hack that can be used - is to check whether the
  arrived character's code  is less (or more or is in the range) than some
  constant for given charset, and if doesn't satisfy constraints on the value, 
  its character type is set to '1' to force conversion to unicode.

 Best regards,
  -Vlad
--- /mnt/shrdfs/home/hvv/src/free/wv/text.c     Fri Nov 17 14:11:06 2000
+++ text.c      Fri Nov 17 20:51:52 2000
@@ -349,19 +349,19 @@
 
     wv_iconv(iconv_handle, &ibuf, &ibuflen, &obuf, &obuflen);
 
+    obuf = buffer2;
 #ifdef WV_SWAP_ICONV
-    if(swap_iconv_u2n(lid))
+    if(!swap_iconv_u2n(lid))
       {
         brute[0] = obuf[0];
         brute[1] = obuf[1];
-        eachchar = (U16) *brute;
       }
     else
       {
         brute[1] = obuf[0];
         brute[0] = obuf[1];
-        eachchar = (U16) *brute;
       }
+    eachchar = *(U16*)brute;      
 #else
     eachchar = (U16)*p;
 #endif /* WV_SWAP_ICONV */

Reply via email to