1

I need to read/write a string of characters using the IBM-1047 character encoding. But when I try this in java using String.getBytes("IBM-1047") a UnsupportedCharacterEncodingException is thrown.

The character encoding is installed on my Windows XP system (confirmed in Control Panel > Regional And Language Options > Advanced Tab).

What am I missing here?

jb10210
  • 1,158
  • 5
  • 15

2 Answers2

0

You need to pass the encoding you are using to the compiler using the -encoding option. See this link for details.

Jeshurun
  • 22,940
  • 6
  • 79
  • 92
0

Take a look at Convert String from ASCII to EBCDIC in Java?, it will almost give you a full answer.

The character encoding you want to use is Cp1047. You can see a full list of supported character encodings here.

Community
  • 1
  • 1
Go Dan
  • 15,194
  • 6
  • 41
  • 65