2 Replies Latest reply on Jan 27, 2010 12:17 PM by 843810

    Default encoding

      I try to setup a default encoding for my application
      java -Dfile.encoding=UTF-8 -jar my_app.jar
      but it doesn't help and the default encoding remains cp1251.
      How can I switch it to UTF8?

      Edited by: ssisqo on Jan 18, 2010 2:40 AM
        • 1. Re: Default encoding
          You can't, at least not completely. Just specify the encoding everywhere your app uses one. Relying on platform default settings is guaranteed to get you in trouble eventually.
          • 2. Re: Default encoding
            Rightly said. Even the internal classes of JDK uses system encoding to convert bytes to character. The data will always be corrupted in case if it is multibyte characters. The best way out is to convert the data specifying ur encoding