I am noticing that across code we use many approaches to encoding UTF-8, all of them slightly wrong :-)
StandardCharsets.UTF_8
Charset.defaultCharset()
CharsetUtil.UTF_8
"UTF-8"
and as additional goodness (?):
build/classes_subst/ch/loway/oss/ari4java/ARI.java:
final String UTF8 = "UTF-8";
My suggestion would be to:
- Define a constant ENCODING in ARI.java that is a Charset and not a String.
- use that constant everywhere (especially where we default to the default encoding!)
Now, should we go for StandardCharsets.UTF_8 or CharsetUtil.UTF_8? what are the pros and cons?
I am noticing that across code we use many approaches to encoding UTF-8, all of them slightly wrong :-)
and as additional goodness (?):
My suggestion would be to:
Now, should we go for StandardCharsets.UTF_8 or CharsetUtil.UTF_8? what are the pros and cons?