Hi, 

 Here is a patch that will make .abw files exported in utf8 rather than in
iso-8859-1 encoding under latin1 locales too since this looses smart quotes
when using libiconv as iconv implementation (this was discussed in thread
started Mar 02 with subject "RE: dogfood feedback -- Smart Quotes").

 This still exports CJK text as numeric entities. If CJK guys think this
should be fixed (i.e. need to export as utf8 too), tell about this and I
will fix this tomorrow.

 Beware: patch will apply with some offset.

 Best regards,
  -Vlad
--- ie_exp_AbiWord_1.cpp-was    Wed Mar 28 22:02:48 2001
+++ ie_exp_AbiWord_1.cpp        Wed Mar 28 22:02:53 2001
@@ -342,7 +342,8 @@
                                while (*plocal)
                                        *pBuf++ = (UT_Byte)*plocal++;
 #      else
-                               if(XAP_EncodingManager::instance->isUnicodeLocale())
+                               if(XAP_EncodingManager::instance->isUnicodeLocale() || 
+
+                                       
+XAP_EncodingManager::instance->try_nativeToU(0xa1)==0xa1)
                                {
                                        XML_Char * pszUTF8 = 
UT_encodeUTF8char(*pData++);
                                        while (*pszUTF8)
@@ -419,7 +420,9 @@
        // any encoding, XML assumes we're using UTF-8.  Note that US-ASCII 
        // is a strict subset of UTF-8. 
 
-       if (!XAP_EncodingManager::instance->cjk_locale()) {
+       if (!XAP_EncodingManager::instance->cjk_locale() &&
+           XAP_EncodingManager::instance->try_nativeToU(0xa1)!=0xa1) {
+           // use utf8 for CJK locales and latin1 locales and unicode locales
            m_pie->write("<?xml version=\"1.0\" encoding=\"");
            m_pie->write(XAP_EncodingManager::instance->getNativeEncodingName());
            m_pie->write("\"?>\n");

Reply via email to