Results 1 to 3 of 3
  1. #1
    geekdad is offline Member
    Join Date
    Nov 2009
    Rep Power

    Default Setting Charset problem

    We have created 2 routines to encode (encrypt) and decode (decrypt) text files. In order to work properly they need to use the same character set, so you can decode an encrypted file and get the same result. This is a running on a linux box.

    In the environment we set LANG=en_US.iso885915 for all users.
    for any normal user everything it encrypts and decrypts uses the right character set.

    The problem is the root account. It always want to encrypt using ASCII (even though LANG is set correctly) and presumably wants to decrypt using that charset as well.

    Even with the decoder forcing the proper character set:
    inStream = new InputStreamReader(fileIn,"ISO8859_15");

    The decoding always fails for root, or if you su from root to any account that normally works

    Anyone got any ideas?

  2. #2
    geekdad is offline Member
    Join Date
    Nov 2009
    Rep Power

    Thumbs up Found the problem

    We've figured it out. Turns out that on Linux you can set an environment variable called LC_ALL

    If you set it to something like LC_ALL=C

    Then all your ls output will come out the way we all like with Uppercase first then lowercase. However it totally buggers up Java when you do this. My advice is not to use it.

    Instead use LC_COLLATE=C

    That will give you the listings you want, in the order you like and not mess with how you want java to work.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

Similar Threads

  1. Having trouble using multi-byte charset?
    By devu1982 in forum Advanced Java
    Replies: 3
    Last Post: 03-03-2009, 05:00 PM
  2. Problem in setting icon for JFrame!
    By pranav13 in forum AWT / Swing
    Replies: 8
    Last Post: 11-04-2008, 06:24 AM
  3. Problem in setting Eclipse
    By Crisanto in forum New To Java
    Replies: 3
    Last Post: 10-29-2008, 07:48 PM
  4. Help with setting up please
    By BlitzA in forum New To Java
    Replies: 6
    Last Post: 12-29-2007, 01:54 PM
  5. Problem Setting offscreen background
    By D34N0 in forum Java Applets
    Replies: 1
    Last Post: 07-14-2007, 12:46 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts