R
Red
Hi all,
I have a question regarding conversion to UTF-8 from a string. I use
the getBytes() string method to get the bytes from the original java
string. For some reason, the string get's cut off. I CAN convert this
string using the nativa2ascii java function to the correct output.
Specifically the example is:
// desired output = 2002年第4四半期の出荷面積を発表
// actual output (newString value) = 2002年第4
// here is the code...
String originalString =
"2002年第4å››å?ŠæœŸã?®å‡ºè?·é?¢ç©?ã‚'発表";
byte []b = s.getBytes();
// create UTF-8 encoded String
String newString = new String( b, 0, length, enc );
What do you think? I have tried using getBytes(<different encodings>)
and none of the tries worked. I have a feeling that the string itself
may be erroneous - the question marks in the string are questionable -
but this is returned from the database itself. ANY thoughts/comments
would be greatly appreciated!
I have a question regarding conversion to UTF-8 from a string. I use
the getBytes() string method to get the bytes from the original java
string. For some reason, the string get's cut off. I CAN convert this
string using the nativa2ascii java function to the correct output.
Specifically the example is:
// desired output = 2002年第4四半期の出荷面積を発表
// actual output (newString value) = 2002年第4
// here is the code...
String originalString =
"2002年第4å››å?ŠæœŸã?®å‡ºè?·é?¢ç©?ã‚'発表";
byte []b = s.getBytes();
// create UTF-8 encoded String
String newString = new String( b, 0, length, enc );
What do you think? I have tried using getBytes(<different encodings>)
and none of the tries worked. I have a feeling that the string itself
may be erroneous - the question marks in the string are questionable -
but this is returned from the database itself. ANY thoughts/comments
would be greatly appreciated!