Java: How to write “Arabic” in properties file?

前端 未结 7 1976
自闭症患者
自闭症患者 2021-01-05 09:32

I want to write \"Arabic\" in the message resource bundle (properties) file but when I try to save it I get this error:

\"Save couldn\'t be completed Some characters

7条回答
  •  再見小時候
    2021-01-05 10:07

    As described in the class reference for "Properties"

    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 ; 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.

提交回复
热议问题