You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:54:55 UTC

[GitHub] [tomcat] gmshake edited a comment on pull request #291: fixed-chinese-encoding

gmshake edited a comment on pull request #291:
URL: https://github.com/apache/tomcat/pull/291#issuecomment-633830923


   @xiaofanTo 
   
   Refer to the javadoc of `java.util.Properties`,  https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html, 
   
   > The load(Reader) / store(Writer, String) methods load and store properties from and to a character based stream in a simple line-oriented format specified below. The load(InputStream) / store(OutputStream, String) methods work the same way as the load(Reader)/store(Writer, String) pair, except the input/output stream is encoded in ISO 8859-1 character encoding. Characters that cannot be directly represented in this encoding can be written using Unicode escapes as defined in section 3.3 of The Java™ Language Specification; only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings.
   
   What you experienced is expected behavior :)
   
   Following the javadoc, try converting the property file `test.properties` with `native2ascii` tool,
   ```bash
   native2ascii test.properties > test.properties
   ```
   you'll get correct console output :)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org