Dominik Schuermann
2014-09-15 07:15:35 UTC
Hi list,
I would like to know if there is any difference between using Bouncy
Castle's function:
Strings.fromUTF8ByteArray(input)
and the Java built in function:
CharsetDecoder cs = Charset.forName("UTF-8").newDecoder();
cs.decode(ByteBuffer.wrap(input));
in terms of output/parsing behavior.
In our project OpenKeychain [0] we sometimes have to deal with OpenPGP
user ids with bad encodings. The Java built-in functions give me much
more feedback on what went wrong, so I would like to switch to them
for converting raw user ids from byte arrays to Strings. Are there
arguments against this, why we should stay with BC's
Strings.fromUTF8ByteArray(input) ?
Regards
Dominik
[0] http://www.openkeychain.org/
I would like to know if there is any difference between using Bouncy
Castle's function:
Strings.fromUTF8ByteArray(input)
and the Java built in function:
CharsetDecoder cs = Charset.forName("UTF-8").newDecoder();
cs.decode(ByteBuffer.wrap(input));
in terms of output/parsing behavior.
In our project OpenKeychain [0] we sometimes have to deal with OpenPGP
user ids with bad encodings. The Java built-in functions give me much
more feedback on what went wrong, so I would like to switch to them
for converting raw user ids from byte arrays to Strings. Are there
arguments against this, why we should stay with BC's
Strings.fromUTF8ByteArray(input) ?
Regards
Dominik
[0] http://www.openkeychain.org/