Convertabilty String to extended ASCII

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dzenanz
    New Member
    • Feb 2008
    • 45

    Convertabilty String to extended ASCII

    If someone comes by the same problem as me (converting string to 8-bit ascii codes), here is the solution:

    Code:
    String s="ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ";
    byte ascii[]=s.getBytes("Cp437");
    Cp437 can be replaced by IBM437, but not by Windows-1252, Latin1, US-ASCII (this is 7-bit ascii) and ISO-8859-1.

    My problem was that I was trying to use "ISO-8859-1" (being nice standards-compliant guy), "ISO_8859_1 ", "8859_1" and such, instead going immediately for the code page 437 (DOS-US, OEM-DOS).

    I hope this will help someone.
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Originally posted by dzenanz
    If someone comes by the same problem as me (converting string to 8-bit ascii codes), here is the solution:

    Code:
    String s="ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ";
    byte ascii[]=s.getBytes("Cp437");
    Cp437 can be replaced by IBM437, but not by Windows-1252, Latin1, US-ASCII (this is 7-bit ascii) and ISO-8859-1.

    My problem was that I was trying to use "ISO-8859-1" (being nice standards-compliant guy), "ISO_8859_1 ", "8859_1" and such, instead going immediately for the code page 437 (DOS-US, OEM-DOS).

    I hope this will help someone.
    I guess it all hinges on how one defines "extended ASCII".

    Comment

    Working...