johvargas / sfdc-wsc

Automatically exported from code.google.com/p/sfdc-wsc
0 stars 0 forks source link

Problems with strings containing non-ascii characters #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

I ran into problems when a call contained a string with international
characters, in my case the Swedish letters "å", "ä" and "ö".

I made a small patch to entity-encode characters above code point 127 in
MXSerializer.java. I'm not sure that this is the best solution, but it
Worked For Me:

@@ -966,6 +966,10 @@ public class MXSerializer {
                         //                  "character zero is not allowed
in XML 1.1 output"+getLocation());
                         //              }
                     }
+                } else if (ch>127) {
+                       if(i > pos) out.write(text.substring(pos, i));
+                    out.write("&#"+((int)ch)+";");
+                    pos = i + 1;
                 }
                 if(seenBracket) {
                     seenBracketBracket = seenBracket = false;

Original issue reported on code.google.com by ugg...@gmail.com on 7 Aug 2009 at 2:03

Attachments: