C
Craig
We have a vendor supplied Java API which takes a String as an argument
(for transmission). The supplier has instructed that we must send a
ISO-8859-2 encoded String to make this work. My argument to them has
been that there is no such thing, and that while we can send a String,
Java maintains its own internal format, and that encoding only comes
into play when converting to/from bytes. Am I incorrect?
We pull this data out of the db as UTF-8 bytes (they are persisted as
a blob). They suggest something like this:
String = new String(bytes, "ISO-8859-2");
where bytes is the byte array from the db. My suggestion to them is
that we still end up with a plain old Java String, and that this
statement may actually corrupt any extended characters, as we are
telling the String constructor that the byte array is encoded as
ISO-8859-2, when actually it is UTF-8.
They have comprimised and instructed us to send them UTF-8 encoded
Strings. But I'm guessing the same issue applies.
Can anyone shed some light?
Thanks
(for transmission). The supplier has instructed that we must send a
ISO-8859-2 encoded String to make this work. My argument to them has
been that there is no such thing, and that while we can send a String,
Java maintains its own internal format, and that encoding only comes
into play when converting to/from bytes. Am I incorrect?
We pull this data out of the db as UTF-8 bytes (they are persisted as
a blob). They suggest something like this:
String = new String(bytes, "ISO-8859-2");
where bytes is the byte array from the db. My suggestion to them is
that we still end up with a plain old Java String, and that this
statement may actually corrupt any extended characters, as we are
telling the String constructor that the byte array is encoded as
ISO-8859-2, when actually it is UTF-8.
They have comprimised and instructed us to send them UTF-8 encoded
Strings. But I'm guessing the same issue applies.
Can anyone shed some light?
Thanks