You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2008/03/17 10:07:48 UTC

svn commit: r637794 [5/5] - in /xerces/c/trunk: src/xercesc/NLS/EN_US/ src/xercesc/util/MsgLoaders/ICU/resources/ src/xercesc/util/MsgLoaders/InMemory/ src/xercesc/util/MsgLoaders/MsgCatalog/ src/xercesc/util/MsgLoaders/Win32/ tools/NLS/Xlat/

Modified: xerces/c/trunk/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp?rev=637794&r1=637793&r2=637794&view=diff
==============================================================================
--- xerces/c/trunk/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp (original)
+++ xerces/c/trunk/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp Mon Mar 17 02:07:38 2008
@@ -105,11 +105,11 @@
 	//
 
 #ifdef ICU_RESBUNDLE_IN_TABLE_FORM
-    fwprintf(fOutFl, L"\t\t %3d { \"%s \" } \n", curId, xmlStrToPrintable(msgText));
+    fwprintf(fOutFl, L"\t\t %3d { \"%s\" } \n", curId, xmlStrToPrintable(msgText));
     releasePrintableStr
 	// need to print leading 0 if less than 100, not tested yet
 #else
-    fwprintf(fOutFl, L"\t\t\"%s \" ,\n", xmlStrToPrintable(msgText));
+    fwprintf(fOutFl, L"\t\t\"%s\" ,\n", xmlStrToPrintable(msgText));
     releasePrintableStr
 	// need a space between the last character and the closing "
 #endif

Modified: xerces/c/trunk/tools/NLS/Xlat/Xlat_Win32RC.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tools/NLS/Xlat/Xlat_Win32RC.cpp?rev=637794&r1=637793&r2=637794&view=diff
==============================================================================
--- xerces/c/trunk/tools/NLS/Xlat/Xlat_Win32RC.cpp (original)
+++ xerces/c/trunk/tools/NLS/Xlat/Xlat_Win32RC.cpp Mon Mar 17 02:07:38 2008
@@ -81,9 +81,27 @@
     //
     fwprintf(fOutFl, L"    %-16d  L\"", messageId + fMsgOffset);
 
+    bool isOnlyASCII=true;
     const XMLCh* rawData = msgText;
     while (*rawData)
-        fwprintf(fOutFl, L"\\x%04lX", *rawData++);
+    {
+        // don't allow " or \ in the message
+        if(*rawData > 0xFF || strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]()',-+ &.;:<>?!|*=/#_", *rawData)==NULL)
+        {
+            isOnlyASCII=false;
+            break;
+        }
+        rawData++;
+    }
+
+    if(isOnlyASCII)
+        fwprintf(fOutFl, msgText);
+    else
+    {
+        const XMLCh* rawData = msgText;
+        while (*rawData)
+            fwprintf(fOutFl, L"\\x%04lX", *rawData++);
+    }
     fwprintf(fOutFl, L"\\x00\"\n");
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org