Character encodings

From: Joel (noemail_at_noemail.com)
Date: 02/04/04


Date: Wed, 04 Feb 2004 10:38:26 -0500

Hi everyone,

Here's someone knows of any easy solution.
I'm looking for an easy way to remove french characters and replace them
with their english equivalent. We currently have acould be found in
java except that java's encoding seems to replace any unrecognized
characters with "?"'s. Is there another way? I really have no
intention of writing my own encoder that searches and replaces each
individual character. Anybody know of anything out there that can
help? I checked out Jakarta Commons Lang but didn't see anything there.
Here is some sample code that demonstrates alittle bit about what I'm
talking about.

public class StringTester {
        public static void main(String[] args) {
                String frenchString = "Jôêl";
                System.out.println("French String: " + frenchString);

                String englishString = "";
                try {
                        test = new String(frenchString.getBytes("US-ASCII"));
                } catch (Exception e){
                        //It's supported.
                }
                
                System.out.println("English String: " + englishString);
        }
}

Output:
French String: Jôêl
English String: J??l

Desired Output
French String: Jôêl
English String: Joel

Any help would be greatly appreciated.

Joel



Relevant Pages

  • Re: Weird Symbols appearing when I type
    ... I initially installed the "Canadian English" version, but unfortunately, Microsoft apparently thinks we all speak and write French up here. ... I changed to "American English", but the French characters do reappear, just as they have for you, on occasion. ... fix it seem to be a reboot of my computer. ...
    (microsoft.public.windows.vista.general)
  • Re: Error "Prop Res Dll Not Loaded" Problem - How can I fix this?!
    ... Searching via Google using the string "propres.dll" is not a very good idea ... and the reason you are getting pages in languages other than english (like ... french) is that "propres" is actually a word in French (which I believe means ...
    (microsoft.public.word.application.errors)
  • Re: This Looks Interesting - The Rocket (Maurice Richard)
    ... meaning characters like Richard & Beliveau ... speak French while characters like Irvin speak English (presumably, ... In Quebec, the English dialog was subtitled in ...
    (rec.sport.hockey)
  • Re: More elegant UTF-8 encoder
    ... still get about 90% of characters. ... French or Russians. ... idea, basically for English, and may be ok for Spanish and German. ...
    (comp.lang.c)
  • Re: Optimization of code
    ... so that with this pragma ... Swedish, German, French, Hungarian, etc. that use accented characters). ... can't put a Lituanian name into a string and see what it really says, ...
    (microsoft.public.vc.mfc)