To maintain special characters in java

Discussion in 'Java' started by Elbrethril, Sep 11, 2006.

  1. Elbrethril

    Elbrethril Guest

    I must elaborate a text (extract from a file) that contains characters
    (type ö ø). How can I conserve them after the elaboration? thanks
    Elbrethril, Sep 11, 2006
    #1
    1. Advertising

  2. Elbrethril

    Oliver Wong Guest

    "Elbrethril" <> wrote in message
    news:...
    > I must elaborate a text (extract from a file) that contains characters
    > (type ö ø). How can I conserve them after the elaboration? thanks


    It's not clear to me what you mean by "Elaborate", but you might want to
    google for these keywords, to see if documents addressing your problem come
    up: encoding, charset, unicode.

    - Oliver
    Oliver Wong, Sep 11, 2006
    #2
    1. Advertising

  3. Elbrethril

    Elbrethril Guest

    > It's not clear to me what you mean by "Elaborate"

    ok. sorry for my english...
    I have a text-file that including these characters, I must write a java
    class that modifies the text, maintaining thes special characters.

    thanks
    Simone
    Elbrethril, Sep 11, 2006
    #3
  4. Elbrethril

    Elbrethril Guest

    > It's not clear to me what you mean by "Elaborate"

    ok. sorry for my english...
    I have a text-file that including these characters, I must write a java
    class that modifies the text, maintaining thes special characters.

    thanks
    Simone
    Elbrethril, Sep 11, 2006
    #4
  5. Elbrethril wrote on 12.09.2006 00:12:
    >> It's not clear to me what you mean by "Elaborate"

    >
    > ok. sorry for my english...
    > I have a text-file that including these characters, I must write a java
    > class that modifies the text, maintaining thes special characters.
    >

    Make sure you use a Reader (e.g. FileReader) together with the approriate
    encoding to read the file, and then later use a Writer (e.g. FileWriter) to
    write the file with the approriate encoding.

    See:
    http://java.sun.com/docs/books/tutorial/essential/io/charstreams.html

    Thomas
    Thomas Kellerer, Sep 11, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Barry Olly
    Replies:
    2
    Views:
    3,897
    Doyle
    Oct 20, 2003
  2. Stefan Mueller
    Replies:
    3
    Views:
    32,960
    Stefan Mueller
    Jul 23, 2006
  3. Replies:
    2
    Views:
    1,075
    Ingo Menger
    May 31, 2007
  4. rvino
    Replies:
    0
    Views:
    4,637
    rvino
    Aug 14, 2007
  5. majna
    Replies:
    4
    Views:
    644
    Thomas 'PointedEars' Lahn
    Sep 19, 2007
Loading...

Share This Page