Skip to content

Commit

Permalink
Working on charset
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Downarowicz committed Feb 27, 2022
1 parent 4b8b6a7 commit 5838983
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/at/downardo/j3270Server/EBCDIC.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public static int[] ebcdic2ascii(byte[] _ebcdic) {
}
try {
byte[] ascii = input.getBytes("ASCII");
//byte[] ascii = input.getBytes("ISO-8859-15");
for(int i = 0; i < ascii.length; i++) {
_asciiReturn[i] = ascii[i];
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/at/downardo/j3270Server/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public static boolean handleField(int addr, byte[] value, HashMap<Integer, Strin

try {
fieldValues.put(name, new String(_t, "UTF-8"));
//fieldValues.put(name, new String(_t, "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/at/downardo/j3270Server/example/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public void run() {

Telnet.NegotiateTelnet(out, in);

EBCDIC.CODEPAGE = "CP1047";
EBCDIC.CODEPAGE = "CP1148";

Field[] fields = {
new Field(0,0,"HALLO WELT TEST", false, true, ""),
new Field(0,0,"HALLO WELT TEST", false, true, ""),
new Field(1,0, "Name ....", false, true, ""),
new Field(1,13, "", true, false, "name")
};
Expand Down Expand Up @@ -68,6 +68,8 @@ public void run() {
fieldValues = r.Values;

System.out.println(fieldValues.get("name"));
System.out.println(EBCDIC.CODEPAGE);

if(r.AID == AID.AIDEnter) {
r = Screen.ShowScreen(screen2, fieldValues, 0, 0, out, in);
}
Expand Down

0 comments on commit 5838983

Please sign in to comment.