Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10519

Re: Handling unicode characters in PI

$
0
0

Hi Senthil

 

Also by writing the java code below you can ignore the unicode characters from file

 

public String stripNonValidXMLCharacters(String in) {

 

StringBuffer out = new StringBuffer();
char current;

 

if (in == null || ("".equals(in))) return "";

 

for (int i = 0; i < in.length(); i++) {

 

current = in.charAt(i);

 

if ((current == 0x9) || (current == 0xA) || (current == 0xD) ||((current >= 0x20) && (current <= 0xD7FF)) ||((current >= 0xE000) && (current <= 0xFFFD)) || ((current >= 0x10000) && (current <= 0x10FFFF)))

 

out.append(current);

}       
return out.toString();

}

 

But the best solution will be correcting your sending system so that it will not send the unicode characters.


Viewing all articles
Browse latest Browse all 10519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>