Hey guys,

After experiencing some unicode trouble with HSSF today, namely setting the cell 
encoding before setting it's text (or lack thereof...), I figured since Java is 
unicode based it's not too friendly to require users to set unicode flags explicitly 
in order for unicode to work. I traced the problem down to UnicodeString.serialize(), 
and found some rather strange code that seems to do nothing (decomposing and creating 
a string, try and catch blocks that are identical...anyone have any ideas?), and 
thought we should have the serializer (or perhaps the constructor?) detect the case 
where the String contains non-ascii/iso-latin chars and set the encoding 
automatically. This can be as simple as a

if (str.equals(new String(str.getBytes("iso8859_1"),"iso8859_1"))) // string can be 
compressed
...

what do u say? any implications I didn't think of?


-Amichai

Reply via email to