Skip to content

Encoding... what a mess. #54

@l3nz

Description

@l3nz

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions