[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-3342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor reassigned ZOOKEEPER-3342:
-----------------------------------------

    Assignee: David Mollitor

> Use StandardCharsets
> --------------------
>
>                 Key: ZOOKEEPER-3342
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3342
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.6.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> {quote}
> Encodes this String into a sequence of bytes using the platform's default 
> charset, storing the result into a new byte array. The behavior of this 
> method when this string cannot be encoded in the default charset is 
> unspecified.
> https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#getBytes--
> {quote}
> Since this is a distributed system, it is always possible that different 
> nodes have different default charsets defined. I think it's most safe to 
> specify it explicitly across all nodes for safety sake. You could for example 
> see a situation where an upgrade JVM uses a different default and during a 
> rolling upgrade of the JVM, different nodes now have a different default.
> * The default charset is usually "ISO-8859-1". UTF-8 covers more of our 
> international friends.
> * Explicitly specifying the CharSet yields slight performance gains
> * Explicitly specifying the CharSet removes the need for try/catch blocks of 
> UnsupportedEncodingException
> https://blog.codecentric.de/en/2014/04/faster-cleaner-code-since-java-7/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to