Character encodings
From: Joel (noemail_at_noemail.com)
Date: 02/04/04
- Next message: Joel: "Re: Character encodings"
- Previous message: Ajay Singh Tomar: "Binding in JiBX with mixed contents"
- Next in thread: Joel: "Re: Character encodings"
- Reply: Joel: "Re: Character encodings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Joel: "Re: Character encodings"
- Previous message: Ajay Singh Tomar: "Binding in JiBX with mixed contents"
- Next in thread: Joel: "Re: Character encodings"
- Reply: Joel: "Re: Character encodings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|