Reputation: 63
I am trying to convert a blob
variable to string. In DB level, the variable contains XML file with Italian character like
(è, ò, à e ...)
The code that I already used is as below:
byte[] result = blob.getBytes(1, (int) blob.length());
String b = new String(result);
System.out.println(b);
The output cannot resolve the special characters. I guess that is because converting these letters into bytes will eliminate their actual values.
Upvotes: 0
Views: 4377
Reputation: 4248
This is actually depends how you convert your String
with non-ASCII characters (Special Characters). You need to specify what encoding
you are using when converting it from blob
to string
.
Upvotes: 0