diff -r b3d0d806cbe2 -r 01d939969b10 res/values/arrays.xml
--- a/res/values/arrays.xml Tue Jun 03 08:48:14 2014 -0700
+++ b/res/values/arrays.xml Mon Jun 16 08:24:00 2014 -0700
@@ -27,6 +27,13 @@
screen
+
+ NONE
+ SSLv2
+ SSLv3
+ TLS
+
+
@string/list_rotation_default@string/list_rotation_land
diff -r b3d0d806cbe2 -r 01d939969b10 res/values/strings.xml
--- a/res/values/strings.xml Tue Jun 03 08:48:14 2014 -0700
+++ b/res/values/strings.xml Mon Jun 16 08:24:00 2014 -0700
@@ -119,6 +119,20 @@
"Host %1$s key fingerprint is %2$s"
+
+ "Version: "
+ "Serial Number: "
+ "Signature Algorithm: "
+ "Issuer: "
+ "Valid From: "
+ "Valid To: "
+ "Subject DN: "
+ "Public Key: "
+ "The certificate is %1$s"
+ "Unknown Certificate - Do you accept it?"
+ "Do you want to save this certificate?"
+ "Enter sys-request string"
+
"Passwords do not match!""Wrong password!""Private key appears corrupt!"
@@ -332,6 +346,13 @@
"Monitor Init String"
+
+ "Emulation mode"
+ "Override global emulation mode / answerback string"
+
+
+ "Host 5250 Encryption"
+
"X11 forwarding"
@@ -501,7 +522,7 @@
"Session will not be started due to host preference.""Enable port forward: %1$s"
- "Failure! Local shell is unavailable on this phone."
+ "Failure! Local shell is unavailable on this device.""%1$s wants your attention."
diff -r b3d0d806cbe2 -r 01d939969b10 res/xml/host_prefs.xml
--- a/res/xml/host_prefs.xml Tue Jun 03 08:48:14 2014 -0700
+++ b/res/xml/host_prefs.xml Mon Jun 16 08:24:00 2014 -0700
@@ -20,141 +20,156 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
+
-
+
-
+
-
+
-
+
diff -r b3d0d806cbe2 -r 01d939969b10 res/xml/preferences.xml
--- a/res/xml/preferences.xml Tue Jun 03 08:48:14 2014 -0700
+++ b/res/xml/preferences.xml Mon Jun 16 08:24:00 2014 -0700
@@ -52,7 +52,7 @@
android:summary="@string/pref_emulation_summary"
android:entries="@array/list_emulation_modes"
android:entryValues="@array/list_emulation_modes"
- android:defaultValue="screen"
+ android:defaultValue="xterm-256color"
/>
parent, View view, int position, long id) {
// launch off to console details
- HostBean host = (HostBean) parent.getAdapter().getItem(position);
+ HostBean host = (HostBean) getListView().getItemAtPosition(position);
Uri uri = host.getUri();
Intent contents = new Intent(Intent.ACTION_VIEW, uri);
contents.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -205,11 +204,10 @@
}
else {
// otherwise just launch activity to show this host
- HostListActivity.this.startActivity(contents);
+ startActivity(contents);
}
}
});
- this.registerForContextMenu(list);
quickconnect = (TextView) this.findViewById(R.id.front_quickconnect);
quickconnect.setVisibility(makingShortcut ? View.GONE : View.VISIBLE);
quickconnect.setOnKeyListener(new OnKeyListener() {
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/TerminalView.java
--- a/src/com/five_ten_sg/connectbot/TerminalView.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/TerminalView.java Mon Jun 16 08:24:00 2014 -0700
@@ -85,6 +85,8 @@
private Matcher mCodeMatcher = null;
private AccessibilityEventSender mEventSender = null;
+ public static String android_home_directory = "";
+
private static final String BACKSPACE_CODE = "\\x08\\x1b\\[K";
private static final String CONTROL_CODE_PATTERN = "\\x1b\\[K[^m]+[m|:]";
@@ -96,6 +98,7 @@
public TerminalView(Context context, TerminalBridge bridge) {
super(context);
+ android_home_directory = context.getApplicationInfo().dataDir;
this.context = context;
this.bridge = bridge;
paint = new Paint();
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/bean/HostBean.java
--- a/src/com/five_ten_sg/connectbot/bean/HostBean.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/bean/HostBean.java Mon Jun 16 08:24:00 2014 -0700
@@ -29,31 +29,33 @@
public static final String BEAN_NAME = "host";
/* Database fields */
- private long id = -1;
- private String nickname = null;
- private String username = null;
- private String hostname = null;
- private int port = 22;
- private String protocol = "ssh";
- private String hostKeyAlgo = null;
- private byte[] hostKey = null;
- private long lastConnect = -1;
- private String color;
+ private long id = -1;
+ private String nickname = null;
+ private String username = null;
+ private String hostname = null;
+ private int port = 22;
+ private String protocol = "ssh";
+ private String hostKeyAlgo = null;
+ private byte[] hostKey = null;
+ private long lastConnect = -1;
+ private String color;
private boolean useKeys = true;
- private String useAuthAgent = HostDatabase.AUTHAGENT_NO;
- private String postLogin = null;
- private long pubkeyId = -1;
+ private String useAuthAgent = HostDatabase.AUTHAGENT_NO;
+ private String postLogin = null;
+ private long pubkeyId = -1;
private boolean wantSession = true;
- private String delKey = HostDatabase.DELKEY_DEL;
- private int fontSize = -1;
+ private String delKey = HostDatabase.DELKEY_DEL;
+ private int fontSize = -1;
private boolean compression = false;
- private String httpproxy = null;
- private String encoding = HostDatabase.ENCODING_DEFAULT;
+ private String httpproxy = null;
+ private String encoding = HostDatabase.ENCODING_DEFAULT;
private boolean stayConnected = false;
private boolean wantX11Forward = false;
- private String x11Host = "localhost";
- private int x11Port = 6000;
- private String monitor = null;
+ private String x11Host = "localhost";
+ private int x11Port = 6000;
+ private String monitor = null;
+ private String hostemulation = null;
+ private String encryption5250 = null;
public HostBean() {
}
@@ -252,6 +254,22 @@
this.monitor = monitor;
}
+ public String getHostEmulation() {
+ return this.hostemulation;
+ }
+
+ public void setHostEmulation(String hostemulation) {
+ this.hostemulation = hostemulation;
+ }
+
+ public String getEncryption5250() {
+ return this.encryption5250;
+ }
+
+ public void setEncryption5250(String encryption5250) {
+ this.encryption5250 = encryption5250;
+ }
+
@Override
public ContentValues getValues() {
ContentValues values = new ContentValues();
@@ -279,6 +297,8 @@
values.put(HostDatabase.FIELD_HOST_X11HOST, x11Host);
values.put(HostDatabase.FIELD_HOST_X11PORT, x11Port);
values.put(HostDatabase.FIELD_HOST_MONITOR, monitor);
+ values.put(HostDatabase.FIELD_HOST_EMULATION, hostemulation);
+ values.put(HostDatabase.FIELD_HOST_ENCRYPTION5250, encryption5250);
return values;
}
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/service/TerminalBridge.java
--- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Mon Jun 16 08:24:00 2014 -0700
@@ -95,13 +95,12 @@
private Relay relay;
- private final String emulation;
- private final int scrollback;
+ private String emulation; // aka answerback string, aka terminal type
public Bitmap bitmap = null;
public vt320 buffer = null;
- private TerminalView parent = null;
+ public TerminalView parent = null;
private final Canvas canvas = new Canvas();
private boolean disconnected = false;
@@ -120,11 +119,10 @@
// TODO add support for the new clipboard API
private ClipboardManager clipboard;
- public int charWidth = -1;
- public int charHeight = -1;
- private int charTop = -1;
-
- private float fontSize = -1;
+ public int charWidth = -1;
+ public int charHeight = -1;
+ private int charTop = -1;
+ private float fontSize = -1;
private final List fontSizeChangedListeners;
@@ -160,7 +158,6 @@
manager = null;
defaultPaint = new Paint();
selectionArea = new SelectionArea();
- scrollback = 1;
localOutput = new LinkedList();
fontSizeChangedListeners = new LinkedList();
transport = null;
@@ -169,16 +166,14 @@
}
/**
- * Create new terminal bridge with following parameters. We will immediately
- * launch thread to start SSH connection and handle any hostkey verification
- * and password authentication.
+ * Create new terminal bridge with following parameters.
*/
public TerminalBridge(final TerminalManager manager, final HostBean host) throws IOException {
float hostFontSize;
this.manager = manager;
this.host = host;
- emulation = manager.getEmulation();
- scrollback = manager.getScrollback();
+ emulation = host.getHostEmulation();
+ if ((emulation == null) || (emulation.length() == 0)) emulation = manager.getEmulation();
// create prompt helper to relay password and hostkey requests up to gui
promptHelper = new PromptHelper(this);
// create our default paint
@@ -191,128 +186,20 @@
Integer defaultFontSize = Integer.parseInt(manager.prefs.getString(PreferenceConstants.DEFAULT_FONT_SIZE, "-1"));
Log.i(TAG, "fontSize: " + this.fontSize + ", defaultFontSize: " + defaultFontSize);
- if (this.fontSize == -1) {
+ if (fontSize == -1) {
if (defaultFontSize > 0 && host.getFontSize() == -1)
hostFontSize = defaultFontSize;
else
hostFontSize = host.getFontSize();
}
else
- hostFontSize = this.fontSize;
+ hostFontSize = fontSize;
- if (hostFontSize <= 0)
- hostFontSize = DEFAULT_FONT_SIZE;
+ if (hostFontSize <= 0) hostFontSize = DEFAULT_FONT_SIZE;
setFontSize(hostFontSize);
- // create terminal buffer and handle outgoing data
- // this is probably status reply information
- buffer = new vt320() {
- @Override
- public void debug(String s) {
- Log.d(TAG, s);
- }
- @Override
- public void write(byte[] b) {
- try {
- if (b != null && transport != null) {
- if (monitor != null) monitor.hostData(b);
- transport.write(b);
- }
- }
- catch (IOException e) {
- Log.e(TAG, "Problem writing outgoing data in vt320() thread", e);
- }
- }
- @Override
- public void write(int b) {
- try {
- if (transport != null) {
- if (monitor != null) monitor.hostData(b);
- transport.write(b);
- }
- }
- catch (IOException e) {
- Log.e(TAG, "Problem writing outgoing data in vt320() thread", e);
- }
- }
- // We don't use telnet sequences.
- @Override
- public void sendTelnetCommand(byte cmd) {
- }
- // We don't want remote to resize our window.
- @Override
- public void setWindowSize(int c, int r) {
- }
- // test for changed screen contents
- @Override
- public void testChanged() {
- if (monitor != null) monitor.testChanged();
- }
- // play beep noise
- @Override
- public void beep() {
- if (parent.isShown())
- manager.playBeep();
- else
- manager.sendActivityNotification(host);
- }
- // monitor placement of new characters
- @Override
- public void putChar(int c, int l, char ch, int attributes) {
- if (monitor != null) monitor.screenChanged(l, c);
-
- super.putChar(c, l, ch, attributes);
- }
- @Override
- public void insertChar(int c, int l, char ch, int attributes) {
- if (monitor != null) monitor.screenChanged(l, l, c, width - 1);
-
- super.insertChar(c, l, ch, attributes);
- }
- @Override
- public void insertLine(int l, int n, boolean scrollDown) {
- if (monitor != null) {
- if (scrollDown) monitor.screenChanged(l, height - 1, 0, width - 1);
- else monitor.screenChanged(0, l, 0, width - 1);
- }
-
- super.insertLine(l, n, scrollDown);
- }
- @Override
- public void deleteLine(int l) {
- if (monitor != null) monitor.screenChanged(l, height - 1, 0, width - 1);
-
- super.deleteLine(l);
- }
- @Override
- public void deleteChar(int c, int l) {
- if (monitor != null) monitor.screenChanged(l, l, c, width - 1);
-
- super.deleteChar(c, l);
- }
- @Override
- public void setCursorPosition(int c, int l) {
- if (monitor != null) monitor.cursorMove(l, c);
-
- super.setCursorPosition(c, l);
- }
- };
-
- // Don't keep any scrollback if a session is not being opened.
- if (host.getWantSession())
- buffer.setBufferSize(scrollback);
- else
- buffer.setBufferSize(0);
-
resetColors();
- buffer.setDisplay(this);
selectionArea = new SelectionArea();
- keyListener = new TerminalKeyListener(manager, this, buffer, host.getEncoding());
-
- String monitor_init = host.getMonitor();
- if ((monitor_init != null) && (monitor_init.length() > 0)) {
- monitor = new TerminalMonitor(manager, buffer, keyListener, parent, monitor_init);
- }
}
public PromptHelper getPromptHelper() {
@@ -323,15 +210,19 @@
* Spawn thread to open connection and start login process.
*/
protected void startConnection() {
- transport = TransportFactory.getTransport(host.getProtocol());
- transport.setBridge(this);
- transport.setManager(manager);
- transport.setHost(host);
- // TODO make this more abstract so we don't litter on AbsTransport
+ transport = TransportFactory.getTransport(host.getProtocol());
+ transport.setLinks(manager, this, host, emulation);
+ buffer = transport.getTransportBuffer();
+ keyListener = transport.getTerminalKeyListener();
+
+ String monitor_init = host.getMonitor();
+ if ((monitor_init != null) && (monitor_init.length() > 0)) {
+ monitor = new TerminalMonitor(manager, buffer, keyListener, parent, monitor_init);
+ }
+
transport.setCompression(host.getCompression());
transport.setHttpproxy(host.getHttpproxy());
transport.setUseAuthAgent(host.getUseAuthAgent());
- transport.setEmulation(emulation);
if (transport.canForwardPorts()) {
for (PortForwardBean portForward : manager.hostdb.getPortForwardsForHost(host))
@@ -367,7 +258,8 @@
* @return charset in use by bridge
*/
public Charset getCharset() {
- return relay.getCharset();
+ if (relay != null) return relay.getCharset();
+ return keyListener.getCharset();
}
/**
@@ -376,9 +268,7 @@
* @param encoding the canonical name of the character encoding
*/
public void setCharset(String encoding) {
- if (relay != null)
- relay.setCharset(encoding);
-
+ if (relay != null) relay.setCharset(encoding);
keyListener.setCharset(encoding);
}
@@ -429,11 +319,8 @@
public void onConnected() {
disconnected = false;
buffer.reset();
- // We no longer need our local output.
- localOutput.clear();
- // previously tried vt100 and xterm for emulation modes
- // "screen" works the best for color and escape codes
buffer.setAnswerBack(emulation);
+ localOutput.clear(); // We no longer need our local output.
if (HostDatabase.DELKEY_BACKSPACE.equals(host.getDelKey()))
buffer.setBackspace(vt320.DELETE_IS_BACKSPACE);
@@ -441,11 +328,15 @@
buffer.setBackspace(vt320.DELETE_IS_DEL);
// create thread to relay incoming connection data to buffer
- relay = new Relay(this, transport, buffer, host.getEncoding());
- Thread relayThread = new Thread(relay);
- relayThread.setDaemon(true);
- relayThread.setName("Relay");
- relayThread.start();
+ // only if needed by the transport
+ if (transport.needsRelay()) {
+ relay = new Relay(this, transport, buffer, host.getEncoding());
+ Thread relayThread = new Thread(relay);
+ relayThread.setDaemon(true);
+ relayThread.setName("Relay");
+ relayThread.start();
+ }
+
// force font-size to make sure we resizePTY as needed
setFontSize(fontSize);
// finally send any post-login string, if requested
@@ -563,8 +454,7 @@
charHeight = (int)FloatMath.ceil(fm.descent - fm.top);
// refresh any bitmap with new font size
- if (parent != null)
- parentChanged(parent);
+ if (parent != null) parentChanged(parent);
for (FontSizeChangedListener ofscl : fontSizeChangedListeners)
ofscl.onFontSizeChanged(size);
@@ -664,8 +554,10 @@
try {
// request a terminal pty resize
- synchronized (buffer) {
- buffer.setScreenSize(columns, rows, true);
+ if (buffer != null) {
+ synchronized (buffer) {
+ buffer.setScreenSize(columns, rows, true);
+ }
}
if (transport != null)
@@ -675,7 +567,7 @@
Log.e(TAG, "Problem while trying to resize screen or PTY", e);
}
- // redraw local output if we don't have a sesson to receive our resize request
+ // redraw local output if we don't have a session to receive our resize request
if (transport == null) {
synchronized (localOutput) {
buffer.reset();
@@ -1246,20 +1138,14 @@
buffer.keyPressed(vt320.KEY_UP, ' ', 0);
else if (result.equals("↓"))
buffer.keyPressed(vt320.KEY_DOWN, ' ', 0);
+ else if (result.equals("T"))
+ buffer.keyPressed(vt320.KEY_TAB, ' ', 0);
else if (result.equals("I"))
buffer.keyPressed(vt320.KEY_INSERT, ' ', 0);
else if (result.equals("D"))
buffer.keyPressed(vt320.KEY_DELETE, ' ', 0);
else if (result.equals("E"))
- buffer.keyTyped(vt320.KEY_ENTER, ' ', 0);
- else if (result.equals("T")) {
- try {
- transport.write(0x09);
- }
- catch (IOException e) {
- Log.e(TAG, "Problem with the arrowsDialog", e);
- }
- }
+ buffer.keyPressed(vt320.KEY_ENTER, ' ', 0);
}
@Override
public void onItemClick(AdapterView p, View v, int pos, long id) {
@@ -1400,8 +1286,7 @@
else if (result.equals("0"))
key = vt320.KEY_F10;
- if (key != 0)
- buffer.keyPressed(key, ' ', 0);
+ if (key != 0) buffer.keyPressed(key, ' ', 0);
dismiss();
}
@@ -1496,10 +1381,7 @@
dismiss();
return true;
}
-
-// return keyListener.onKey(parent, event.getKeyCode(), event);
}
-
return super.dispatchKeyEvent(event);
}
};
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java
--- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Mon Jun 16 08:24:00 2014 -0700
@@ -17,6 +17,8 @@
package com.five_ten_sg.connectbot.service;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
import java.lang.ref.WeakReference;
import java.util.List;
@@ -44,7 +46,6 @@
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Toast;
import de.mud.terminal.VDUBuffer;
import de.mud.terminal.vt320;
@@ -80,30 +81,25 @@
public final static int META_TRANSIENT = META_CTRL_ON | META_ALT_ON
| META_SHIFT_ON;
- private final TerminalManager manager;
- private final TerminalBridge bridge;
- private final vt320 buffer;
+ protected final TerminalManager manager;
+ protected final TerminalBridge bridge;
+ protected final vt320 buffer;
+ protected String encoding;
- private String keymode = null;
- private boolean hardKeyboard = false;
- private String customKeyboard = null;
+ protected String keymode = null;
+ protected boolean hardKeyboard = false;
+ protected boolean hardKeyboardHidden;
+ protected String customKeyboard = null;
- private int metaState = 0;
-
- private int mDeadKey = 0;
+ protected int metaState = 0;
+ protected int mDeadKey = 0;
// TODO add support for the new API.
private ClipboardManager clipboard = null;
-
private boolean selectingForCopy = false;
- private final SelectionArea selectionArea;
+ private final SelectionArea selectionArea;
+ protected final SharedPreferences prefs;
- private String encoding;
-
- private final SharedPreferences prefs;
-
- private Toast debugToast = null;
- private Toast metakeyToast = null;
public TerminalKeyListener(TerminalManager manager,
TerminalBridge bridge,
@@ -116,14 +112,24 @@
selectionArea = new SelectionArea();
prefs = PreferenceManager.getDefaultSharedPreferences(manager);
prefs.registerOnSharedPreferenceChangeListener(this);
- hardKeyboard = (manager.res.getConfiguration().keyboard
- == Configuration.KEYBOARD_QWERTY);
+ hardKeyboard = (manager.res.getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY);
+ hardKeyboardHidden = manager.hardKeyboardHidden;
updateKeymode();
updateCustomKeymap();
}
public void sendEscape() {
- buffer.write(0x1b);
+ buffer.keyPressed(vt320.KEY_ESCAPE, ' ', getStateForBuffer());
+ }
+
+ protected void sendEncoded(String s) {
+ byte [] b = null;
+ try {
+ b = s.getBytes(encoding);
+ }
+ catch (UnsupportedEncodingException e){
+ }
+ if (b != null) buffer.write(b);
}
/**
@@ -133,28 +139,18 @@
public boolean onKey(View v, int keyCode, KeyEvent event) {
try {
// skip keys if we aren't connected yet or have been disconnected
- if (bridge.isDisconnected() || bridge.transport == null)
- return false;
-
- final boolean hardKeyboardHidden = manager.hardKeyboardHidden;
+ if (bridge.isDisconnected()) return false;
// Ignore all key-up events except for the special keys
if (event.getAction() == KeyEvent.ACTION_UP) {
// There's nothing here for virtual keyboard users.
- if (!hardKeyboard || (hardKeyboard && hardKeyboardHidden))
- return false;
+ if (!hardKeyboard || hardKeyboardHidden) return false;
// if keycode debugging enabled, log and print the pressed key
if (prefs.getBoolean(PreferenceConstants.DEBUG_KEYCODES, false)) {
String keyCodeString = String.format(": %d", keyCode);
String toastText = v.getContext().getString(R.string.keycode_pressed) + keyCodeString;
-
- if (debugToast == null)
- debugToast = Toast.makeText(v.getContext(), toastText, Toast.LENGTH_LONG);
- else
- debugToast.setText(toastText);
-
- debugToast.show();
+ Log.d(TAG, toastText);
}
if (fullKeyboard()) {
@@ -187,7 +183,7 @@
else if (keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT
&& (metaState & META_TAB) != 0) {
metaState &= ~(META_TAB | META_TRANSIENT);
- buffer.write(0x09);
+ buffer.keyPressed(vt320.KEY_TAB, ' ', getStateForBuffer());
return true;
}
}
@@ -201,7 +197,7 @@
else if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
&& (metaState & META_TAB) != 0) {
metaState &= ~(META_TAB | META_TRANSIENT);
- buffer.write(0x09);
+ buffer.keyPressed(vt320.KEY_TAB, ' ', getStateForBuffer());
return true;
}
}
@@ -213,8 +209,7 @@
if (keyCode == KeyEvent.KEYCODE_UNKNOWN &&
event.getAction() == KeyEvent.ACTION_MULTIPLE) {
- byte[] input = event.getCharacters().getBytes(encoding);
- buffer.write(input);
+ sendEncoded(event.getCharacters());
return true;
}
@@ -288,8 +283,7 @@
// If there is no hard keyboard or there is a hard keyboard currently hidden,
// CTRL-1 through CTRL-9 will send F1 through F9
- if ((!hardKeyboard || (hardKeyboard && hardKeyboardHidden))
- && sendFunctionKey(keyCode))
+ if ((!hardKeyboard || hardKeyboardHidden) && sendFunctionKey(keyCode))
return true;
uchar = keyAsControl(uchar);
@@ -305,9 +299,7 @@
if (uchar < 0x80)
buffer.write(uchar);
else
- // TODO write encoding routine that doesn't allocate each time
- buffer.write(new String(Character.toChars(uchar))
- .getBytes(encoding));
+ sendEncoded(new String(Character.toChars(uchar)));
return true;
}
@@ -332,7 +324,7 @@
}
else if ((orgMetaState & KeyEvent.META_ALT_ON) != 0) {
sendMeta = true;
- buffer.write(0x1b);
+ sendEscape();
}
if (sendMeta || sendCtrl) {
@@ -357,7 +349,7 @@
return true;
}
else if ((orgMetaState & KeyEvent.META_ALT_ON) != 0) {
- buffer.write(0x1b);
+ sendEscape();
buffer.write(k);
return true;
}
@@ -433,11 +425,11 @@
// look for special chars
switch (keyCode) {
case KEYCODE_ESCAPE:
- buffer.write(0x1b);
+ sendEscape();
return true;
case KeyEvent.KEYCODE_TAB:
- buffer.write(0x09);
+ buffer.keyPressed(vt320.KEY_TAB, ' ', getStateForBuffer());
return true;
case KEYCODE_PAGE_DOWN:
@@ -472,7 +464,7 @@
return (handleShortcut(v, hwbuttonShortcut));
case KeyEvent.KEYCODE_VOLUME_UP:
- // check to see which shortcut the camera button triggers
+ // check to see which shortcut the volume button triggers
hwbuttonShortcut = manager.prefs.getString(
PreferenceConstants.VOLUP,
PreferenceConstants.HWBUTTON_CTRL);
@@ -486,7 +478,7 @@
return (handleShortcut(v, hwbuttonShortcut));
case KeyEvent.KEYCODE_SEARCH:
- // check to see which shortcut the camera button triggers
+ // check to see which shortcut the search button triggers
hwbuttonShortcut = manager.prefs.getString(
PreferenceConstants.SEARCH,
PreferenceConstants.HWBUTTON_ESC);
@@ -494,19 +486,17 @@
case KeyEvent.KEYCODE_DEL:
if ((metaState & META_ALT_MASK) != 0) {
- buffer.keyPressed(vt320.KEY_INSERT, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_INSERT, ' ', getStateForBuffer());
}
else {
- buffer.keyPressed(vt320.KEY_BACK_SPACE, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_BACK_SPACE, ' ', getStateForBuffer());
}
metaState &= ~META_TRANSIENT;
return true;
case KeyEvent.KEYCODE_ENTER:
- buffer.write('\r');
+ buffer.keyPressed(vt320.KEY_ENTER, ' ', getStateForBuffer());
metaState &= ~META_TRANSIENT;
return true;
@@ -517,12 +507,10 @@
}
else {
if ((metaState & META_ALT_MASK) != 0) {
- buffer.keyPressed(vt320.KEY_HOME, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_HOME, ' ', getStateForBuffer());
}
else {
- buffer.keyPressed(vt320.KEY_LEFT, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_LEFT, ' ', getStateForBuffer());
}
metaState &= ~META_TRANSIENT;
@@ -538,12 +526,10 @@
}
else {
if ((metaState & META_ALT_MASK) != 0) {
- buffer.keyPressed(vt320.KEY_PAGE_UP, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_PAGE_UP, ' ', getStateForBuffer());
}
else {
- buffer.keyPressed(vt320.KEY_UP, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_UP, ' ', getStateForBuffer());
}
metaState &= ~META_TRANSIENT;
@@ -559,12 +545,10 @@
}
else {
if ((metaState & META_ALT_MASK) != 0) {
- buffer.keyPressed(vt320.KEY_PAGE_DOWN, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_PAGE_DOWN, ' ', getStateForBuffer());
}
else {
- buffer.keyPressed(vt320.KEY_DOWN, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_DOWN, ' ', getStateForBuffer());
}
metaState &= ~META_TRANSIENT;
@@ -580,12 +564,10 @@
}
else {
if ((metaState & META_ALT_MASK) != 0) {
- buffer.keyPressed(vt320.KEY_END, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_END, ' ', getStateForBuffer());
}
else {
- buffer.keyPressed(vt320.KEY_RIGHT, ' ',
- getStateForBuffer());
+ buffer.keyPressed(vt320.KEY_RIGHT, ' ', getStateForBuffer());
}
metaState &= ~META_TRANSIENT;
@@ -599,22 +581,10 @@
return true;
}
}
- catch (IOException e) {
- Log.e(TAG, "Problem while trying to handle an onKey() event", e);
-
- try {
- bridge.transport.flush();
- }
- catch (IOException ioe) {
- Log.d(TAG, "Our transport was closed, dispatching disconnect event");
- bridge.dispatchDisconnect(false);
- }
- }
catch (NullPointerException npe) {
Log.d(TAG, "Input before connection established ignored.");
return true;
}
-
return false;
}
@@ -627,7 +597,7 @@
metaPress(META_CTRL_ON);
}
else if (PreferenceConstants.HWBUTTON_TAB.equals(shortcut)) {
- buffer.write(0x09);
+ buffer.keyPressed(vt320.KEY_TAB, ' ', getStateForBuffer());
}
else if (PreferenceConstants.HWBUTTON_CTRLA_SPACE.equals(shortcut)) {
buffer.write(0x01);
@@ -638,10 +608,10 @@
}
else if (PreferenceConstants.HWBUTTON_ESC.equals(shortcut)) {
showMetakeyToast(v, PreferenceConstants.HWBUTTON_ESC);
- buffer.write(0x1b);
+ sendEscape();
}
else if (PreferenceConstants.HWBUTTON_ESC_A.equals(shortcut)) {
- buffer.write(0x1b);
+ sendEscape();
buffer.write('a');
}
else {
@@ -652,13 +622,7 @@
}
private void showMetakeyToast(View v, String keyname) {
- if (metakeyToast == null)
- metakeyToast = Toast.makeText(v.getContext(), keyname, Toast.LENGTH_LONG);
- else
- metakeyToast.setText(keyname);
-
- metakeyToast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 0);
- metakeyToast.show();
+ Log.d(TAG, keyname);
}
public int keyAsControl(int key) {
@@ -816,7 +780,7 @@
}
}
- private void metaKeyUp(int code) {
+ protected void metaKeyUp(int code) {
if ((metaState & code) != 0) {
metaState &= ~code;
bridge.redraw();
@@ -902,9 +866,11 @@
this.encoding = encoding;
}
-
+ public Charset getCharset() {
+ return Charset.forName(encoding);
+ }
- private void ctrlKeySpecial() {
+ protected void ctrlKeySpecial() {
if (selectingForCopy) {
if (selectionArea.isSelectingOrigin())
selectionArea.finishSelectingOrigin();
@@ -913,10 +879,6 @@
// copy selected area to clipboard
String copiedText = selectionArea.copyFrom(buffer);
clipboard.setText(copiedText);
- // XXX STOPSHIP
-// manager.notifyUser(manager.getString(
-// R.string.console_copy_done,
-// copiedText.length()));
selectingForCopy = false;
selectionArea.reset();
}
@@ -924,7 +886,7 @@
}
else {
if ((metaState & META_CTRL_ON) != 0) {
- buffer.write(0x1b);
+ sendEscape();
metaState &= ~META_CTRL_ON;
}
else
@@ -934,7 +896,7 @@
bridge.redraw();
}
- private boolean customKeymapAction(View v, int keyCode, KeyEvent event) {
+ protected boolean customKeymapAction(View v, int keyCode, KeyEvent event) {
if (bridge == null || customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_DISABLED))
return false;
@@ -964,7 +926,7 @@
// screen (-1) or the Asus Transformer Keyboard Dock.
// Treat the HW button as ESC.
if (event.getDeviceId() > 0) {
- buffer.write(0x1b);
+ sendEscape();
return true;
}
}
@@ -1058,12 +1020,14 @@
// Samsung Captivate Glide (SGH-i927)
if (keyCode == 115) {
// .com key = ESC
- c = 0x1b;
+ c = 0x00;
+ termKey = vt320.KEY_ESCAPE;
return true;
}
else if (keyCode == 116) {
// Microphone key = TAB
- c = 0x09;
+ c = 0x00;
+ termKey = vt320.KEY_TAB;
}
else if ((metaState & META_ALT_MASK) != 0 && (metaState & META_SHIFT_MASK) != 0) {
switch (keyCode) {
@@ -1089,11 +1053,13 @@
// Samsung Captivate Glide (SGH-i927) Ice Cream Sandwich (4.0.x)
if (keyCode == 226) {
// .com key = ESC
- c = 0x1b;
+ c = 0x00;
+ termKey = vt320.KEY_ESCAPE;
}
else if (keyCode == 220) {
// Microphone key = TAB
- c = 0x09;
+ c = 0x00;
+ termKey = vt320.KEY_TAB;
}
else if ((metaState & META_ALT_MASK) != 0 && (metaState & META_SHIFT_MASK) != 0) {
switch (keyCode) {
@@ -1155,7 +1121,7 @@
return false;
}
- private boolean fullKeyboard() {
+ protected boolean fullKeyboard() {
if (customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_FULL) ||
(customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_ASUS_TF)))
return true;
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/service/TerminalManager.java
--- a/src/com/five_ten_sg/connectbot/service/TerminalManager.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalManager.java Mon Jun 16 08:24:00 2014 -0700
@@ -252,7 +252,7 @@
}
public String getEmulation() {
- return prefs.getString(PreferenceConstants.EMULATION, "screen");
+ return prefs.getString(PreferenceConstants.EMULATION, "xterm-256color");
}
public int getScrollback() {
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/service/TerminalMonitor.java
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/AbsTransport.java
--- a/src/com/five_ten_sg/connectbot/transport/AbsTransport.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/AbsTransport.java Mon Jun 16 08:24:00 2014 -0700
@@ -24,29 +24,126 @@
import com.five_ten_sg.connectbot.bean.HostBean;
import com.five_ten_sg.connectbot.bean.PortForwardBean;
import com.five_ten_sg.connectbot.service.TerminalBridge;
+import com.five_ten_sg.connectbot.service.TerminalKeyListener;
import com.five_ten_sg.connectbot.service.TerminalManager;
import android.content.Context;
import android.net.Uri;
+import android.util.Log;
+import de.mud.terminal.vt320;
/**
* @author Kenny Root
*
*/
public abstract class AbsTransport {
- HostBean host;
- TerminalBridge bridge;
- TerminalManager manager;
+ protected String TAG;
+ protected TerminalManager manager;
+ protected TerminalBridge bridge;
+ protected HostBean host;
+ protected vt320 buffer = null;
+ protected String emulation;
+
+ class vt320Default extends vt320 {
+ @Override
+ public void debug(String s) {
+ Log.d(TAG, s);
+ }
+
+ // terminal key listener sending to the host
+ @Override
+ public void write(byte[] b) {
+ try {
+ if (bridge.monitor != null) bridge.monitor.hostData(b);
+
+ AbsTransport.this.write(b);
+ }
+ catch (IOException e) {
+ Log.e(TAG, "Problem writing outgoing data in vt320() thread", e);
+ }
+ }
+ @Override
+ public void write(int b) {
+ try {
+ if (bridge.monitor != null) bridge.monitor.hostData(b);
+
+ AbsTransport.this.write(b);
+ }
+ catch (IOException e) {
+ Log.e(TAG, "Problem writing outgoing data in vt320() thread", e);
+ }
+ }
- String emulation;
+ // We don't use telnet sequences.
+ @Override
+ public void sendTelnetCommand(byte cmd) {
+ }
+ // We don't want remote to resize our window.
+ @Override
+ public void setWindowSize(int c, int r) {
+ }
+ // play beep noise
+ @Override
+ public void beep() {
+ if ((bridge.parent != null) && (bridge.parent.isShown()))
+ manager.playBeep();
+ else
+ manager.sendActivityNotification(host);
+ }
+
+ // test for changed screen contents
+ @Override
+ public void testChanged() {
+ if (bridge.monitor != null) bridge.monitor.testChanged();
+ }
+ // relay socket writing to the screen
+ // bridge.monitor placement of new characters
+ @Override
+ public void putChar(int c, int l, char ch, int attributes) {
+ if (bridge.monitor != null) bridge.monitor.screenChanged(l, c);
+
+ super.putChar(c, l, ch, attributes);
+ }
+ @Override
+ public void insertChar(int c, int l, char ch, int attributes) {
+ if (bridge.monitor != null) bridge.monitor.screenChanged(l, l, c, width - 1);
+
+ super.insertChar(c, l, ch, attributes);
+ }
+ @Override
+ public void insertLine(int l, int n, boolean scrollDown) {
+ if (bridge.monitor != null) {
+ if (scrollDown) bridge.monitor.screenChanged(l, height - 1, 0, width - 1);
+ else bridge.monitor.screenChanged(0, l, 0, width - 1);
+ }
+
+ super.insertLine(l, n, scrollDown);
+ }
+ @Override
+ public void deleteLine(int l) {
+ if (bridge.monitor != null) bridge.monitor.screenChanged(l, height - 1, 0, width - 1);
+
+ super.deleteLine(l);
+ }
+ @Override
+ public void deleteChar(int c, int l) {
+ if (bridge.monitor != null) bridge.monitor.screenChanged(l, l, c, width - 1);
+
+ super.deleteChar(c, l);
+ }
+ @Override
+ public void setCursorPosition(int c, int l) {
+ if (bridge.monitor != null) bridge.monitor.cursorMove(l, c);
+
+ super.setCursorPosition(c, l);
+ }
+
+ // monitor setField()
+
+ };
+
public AbsTransport() {}
- public AbsTransport(HostBean host, TerminalBridge bridge, TerminalManager manager) {
- this.host = host;
- this.bridge = bridge;
- this.manager = manager;
- }
-
/**
* @return protocol part of the URI
*/
@@ -58,9 +155,8 @@
* Encode the current transport into a URI that can be passed via intent calls.
* @return URI to host
*/
- public static Uri getUri(String input) {
- return null;
- }
+ public abstract Uri getUri(String input);
+
/**
* Causes transport to connect to the target host. After connecting but before a
@@ -145,24 +241,27 @@
// do nothing
}
- public void setEmulation(String emulation) {
- this.emulation = emulation;
- }
-
public String getEmulation() {
return emulation;
}
- public void setHost(HostBean host) {
- this.host = host;
+ protected vt320 setupTransportBuffer() {
+ int scrollback = (host.getWantSession()) ? manager.getScrollback() : 0;
+ buffer.setBufferSize(scrollback);
+ buffer.setDisplay(bridge);
+ return buffer;
}
- public void setBridge(TerminalBridge bridge) {
- this.bridge = bridge;
+ public vt320 getTransportBuffer() {
+ buffer = new vt320Default();
+ return setupTransportBuffer();
}
- public void setManager(TerminalManager manager) {
- this.manager = manager;
+ public void setLinks(TerminalManager manager, TerminalBridge bridge, HostBean host, String emulation) {
+ this.manager = manager;
+ this.bridge = bridge;
+ this.host = host;
+ this.emulation = emulation;
}
/**
@@ -248,14 +347,14 @@
return false;
}
- public abstract boolean isConnected();
- public abstract boolean isSessionOpen();
- public abstract boolean isAuthenticated();
/**
* @return int default port for protocol
*/
public abstract int getDefaultPort();
+ public abstract boolean isConnected();
+ public abstract boolean isSessionOpen();
+ public abstract boolean isAuthenticated();
/**
* @param username
@@ -282,12 +381,26 @@
* @param context context containing the correct resources
* @return string that hints at the format for connection
*/
- public static String getFormatHint(Context context) {
- return "???";
+ public abstract String getFormatHint(Context context);
+
+ /**
+ * @return do we use the network
+ */
+ public abstract boolean usesNetwork();
+
+ /**
+ * @return do we need a relay object to read from the transport
+ * and send the data into the vt320 buffer
+ */
+ public boolean needsRelay() {
+ return true;
}
/**
- * @return
+ * @return a key listener
*/
- public abstract boolean usesNetwork();
+ public TerminalKeyListener getTerminalKeyListener() {
+ return new TerminalKeyListener(manager, bridge, buffer, host.getEncoding());
+ }
+
}
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/Local.java
--- a/src/com/five_ten_sg/connectbot/transport/Local.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/Local.java Mon Jun 16 08:24:00 2014 -0700
@@ -41,12 +41,10 @@
public class Local extends AbsTransport {
private static final String TAG = "ConnectBot.Local";
private static final String PROTOCOL = "local";
-
private static final String DEFAULT_URI = "local:#Local";
- private FileDescriptor shellFd;
-
- private FileInputStream is;
+ private FileDescriptor shellFd;
+ private FileInputStream is;
private FileOutputStream os;
/**
@@ -55,37 +53,23 @@
public Local() {
}
- /**
- * @param host
- * @param bridge
- * @param manager
- */
- public Local(HostBean host, TerminalBridge bridge, TerminalManager manager) {
- super(host, bridge, manager);
- }
public static String getProtocolName() {
return PROTOCOL;
}
- @Override
- public void close() {
- try {
- if (os != null) {
- os.close();
- os = null;
- }
+
+ public Uri getUri(String input) {
+ Uri uri = Uri.parse(DEFAULT_URI);
- if (is != null) {
- is.close();
- is = null;
- }
+ if (input != null && input.length() > 0) {
+ uri = uri.buildUpon().fragment(input).build();
}
- catch (IOException e) {
- Log.e(TAG, "Couldn't close shell", e);
- }
+
+ return uri;
}
+
@Override
public void connect() {
int[] pids = new int[1];
@@ -115,35 +99,6 @@
bridge.onConnected();
}
- @Override
- public void flush() throws IOException {
- os.flush();
- }
-
- @Override
- public String getDefaultNickname(String username, String hostname, int port) {
- return DEFAULT_URI;
- }
-
- @Override
- public int getDefaultPort() {
- return 0;
- }
-
- @Override
- public boolean isConnected() {
- return is != null && os != null;
- }
-
- @Override
- public boolean isSessionOpen() {
- return is != null && os != null;
- }
-
- @Override
- public boolean isAuthenticated() {
- return isConnected();
- }
@Override
public boolean willBlock() {
@@ -166,16 +121,6 @@
}
@Override
- public void setDimensions(int columns, int rows, int width, int height) {
- try {
- Exec.setPtyWindowSize(shellFd, rows, columns, width, height);
- }
- catch (Exception e) {
- Log.e(TAG, "Couldn't resize pty", e);
- }
- }
-
- @Override
public void write(byte[] buffer) throws IOException {
if (os != null)
os.write(buffer);
@@ -187,14 +132,68 @@
os.write(c);
}
- public static Uri getUri(String input) {
- Uri uri = Uri.parse(DEFAULT_URI);
+ @Override
+ public void flush() throws IOException {
+ os.flush();
+ }
+
+ @Override
+ public void close() {
+ try {
+ if (os != null) {
+ os.close();
+ os = null;
+ }
+
+ if (is != null) {
+ is.close();
+ is = null;
+ }
+ }
+ catch (IOException e) {
+ Log.e(TAG, "Couldn't close shell", e);
+ }
+ }
- if (input != null && input.length() > 0) {
- uri = uri.buildUpon().fragment(input).build();
+ @Override
+ public void setDimensions(int columns, int rows, int width, int height) {
+ try {
+ Exec.setPtyWindowSize(shellFd, rows, columns, width, height);
+ }
+ catch (Exception e) {
+ Log.e(TAG, "Couldn't resize pty", e);
}
+ }
- return uri;
+ @Override
+ public int getDefaultPort() {
+ return 0;
+ }
+
+ @Override
+ public boolean isConnected() {
+ return is != null && os != null;
+ }
+
+ @Override
+ public boolean isSessionOpen() {
+ return isConnected();
+ }
+
+ @Override
+ public boolean isAuthenticated() {
+ return isConnected();
+ }
+
+ @Override
+ public String getDefaultNickname(String username, String hostname, int port) {
+ return DEFAULT_URI;
+ }
+
+ @Override
+ public void getSelectionArgs(Uri uri, Map selection) {
+ selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
+ selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
}
@Override
@@ -214,19 +213,10 @@
return host;
}
- @Override
- public void getSelectionArgs(Uri uri, Map selection) {
- selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
- selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
- }
-
- public static String getFormatHint(Context context) {
+ public String getFormatHint(Context context) {
return context.getString(R.string.hostpref_nickname_title);
}
- /* (non-Javadoc)
- * @see com.five_ten_sg.connectbot.transport.AbsTransport#usesNetwork()
- */
@Override
public boolean usesNetwork() {
return false;
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/SSH.java
--- a/src/com/five_ten_sg/connectbot/transport/SSH.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/SSH.java Mon Jun 16 08:24:00 2014 -0700
@@ -82,18 +82,6 @@
*
*/
public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveCallback, AuthAgentCallback {
- public SSH() {
- super();
- }
-
- /**
- * @param bridge
- * @param db
- */
- public SSH(HostBean host, TerminalBridge bridge, TerminalManager manager) {
- super(host, bridge, manager);
- }
-
private static final String PROTOCOL = "ssh";
private static final String TAG = "ConnectBot.SSH";
private static final int DEFAULT_PORT = 22;
@@ -211,6 +199,60 @@
}
+
+ public SSH() {
+ super();
+ }
+
+
+ /**
+ * @return protocol part of the URI
+ */
+ public static String getProtocolName() {
+ return PROTOCOL;
+ }
+
+
+ public Uri getUri(String input) {
+ Matcher matcher = hostmask.matcher(input);
+
+ if (!matcher.matches())
+ return null;
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(PROTOCOL)
+ .append("://")
+ .append(Uri.encode(matcher.group(1)))
+ .append('@')
+ .append(matcher.group(2));
+ String portString = matcher.group(4);
+ int port = DEFAULT_PORT;
+
+ if (portString != null) {
+ try {
+ port = Integer.parseInt(portString);
+
+ if (port < 1 || port > 65535) {
+ port = DEFAULT_PORT;
+ }
+ }
+ catch (NumberFormatException nfe) {
+ // Keep the default port
+ }
+ }
+
+ if (port != DEFAULT_PORT) {
+ sb.append(':')
+ .append(port);
+ }
+
+ sb.append("/#")
+ .append(Uri.encode(input));
+ Uri uri = Uri.parse(sb.toString());
+ return uri;
+ }
+
+
private void authenticate() {
try {
if (connection.authenticateWithNone(host.getUsername())) {
@@ -302,6 +344,7 @@
}
}
+
/**
* Attempt connection with database row pointed to by cursor.
* @param cursor
@@ -370,6 +413,7 @@
return tryPublicKey(host.getUsername(), pubkey.getNickname(), pair);
}
+
private boolean tryPublicKey(String username, String keyNickname, KeyPair pair) throws IOException {
//bridge.outputLine(String.format("Attempting 'publickey' with key '%s' [%s]...", keyNickname, trileadKey.toString()));
boolean success = connection.authenticateWithPublicKey(username, pair);
@@ -380,6 +424,7 @@
return success;
}
+
/**
* Internal method to request actual PTY terminal once we've finished
* authentication. If called before authenticated, it will just fail.
@@ -431,6 +476,7 @@
}
}
+
@Override
public void connect() {
connection = new Connection(host.getHostname(), host.getPort());
@@ -536,31 +582,6 @@
}
}
- @Override
- public void close() {
- connected = false;
-
- if (session != null) {
- session.close();
- session = null;
- }
-
- if (connection != null) {
- connection.close();
- connection = null;
- }
- }
-
- private void onDisconnect() {
- close();
- bridge.dispatchDisconnect(false);
- }
-
- @Override
- public void flush() throws IOException {
- if (stdin != null)
- stdin.flush();
- }
@Override
public boolean willBlock() {
@@ -572,6 +593,7 @@
}
}
+
@Override
public int read(byte[] buffer, int start, int len) throws IOException {
int bytesRead = 0;
@@ -601,18 +623,81 @@
return bytesRead;
}
+
@Override
public void write(byte[] buffer) throws IOException {
if (stdin != null)
stdin.write(buffer);
}
+
@Override
public void write(int c) throws IOException {
if (stdin != null)
stdin.write(c);
}
+
+ @Override
+ public void flush() throws IOException {
+ if (stdin != null)
+ stdin.flush();
+ }
+
+
+ public void connectionLost(Throwable reason) {
+ onDisconnect();
+ }
+
+
+ private void onDisconnect() {
+ close();
+ bridge.dispatchDisconnect(false);
+ }
+
+
+ @Override
+ public void close() {
+ connected = false;
+
+ if (session != null) {
+ session.close();
+ session = null;
+ }
+
+ if (connection != null) {
+ connection.close();
+ connection = null;
+ }
+ }
+
+
+ @Override
+ public void setDimensions(int columns, int rows, int width, int height) {
+ this.columns = columns;
+ this.rows = rows;
+
+ if (sessionOpen) {
+ try {
+ session.resizePTY(columns, rows, width, height);
+ }
+ catch (IOException e) {
+ Log.e(TAG, "Couldn't send resize PTY packet", e);
+ }
+ }
+ }
+
+
+ @Override
+ public void setOptions(Map options) {
+ if (options.containsKey("compression"))
+ compression = Boolean.parseBoolean(options.get("compression"));
+
+ if (options.containsKey("httpproxy"))
+ httpproxy = options.get("httpproxy");
+ }
+
+
@Override
public Map getOptions() {
Map options = new HashMap();
@@ -624,36 +709,22 @@
return options;
}
+
@Override
- public void setOptions(Map options) {
- if (options.containsKey("compression"))
- compression = Boolean.parseBoolean(options.get("compression"));
-
- if (options.containsKey("httpproxy"))
- httpproxy = options.get("httpproxy");
+ public void setCompression(boolean compression) {
+ this.compression = compression;
}
- public static String getProtocolName() {
- return PROTOCOL;
- }
@Override
- public boolean isSessionOpen() {
- return sessionOpen;
+ public void setHttpproxy(String httpproxy) {
+ this.httpproxy = httpproxy;
}
+
@Override
- public boolean isConnected() {
- return connected;
- }
-
- @Override
- public boolean isAuthenticated() {
- return authenticated;
- }
-
- public void connectionLost(Throwable reason) {
- onDisconnect();
+ public void setUseAuthAgent(String useAuthAgent) {
+ this.useAuthAgent = useAuthAgent;
}
@Override
@@ -863,26 +934,31 @@
}
}
- @Override
- public void setDimensions(int columns, int rows, int width, int height) {
- this.columns = columns;
- this.rows = rows;
-
- if (sessionOpen) {
- try {
- session.resizePTY(columns, rows, width, height);
- }
- catch (IOException e) {
- Log.e(TAG, "Couldn't send resize PTY packet", e);
- }
- }
- }
@Override
public int getDefaultPort() {
return DEFAULT_PORT;
}
+
+ @Override
+ public boolean isConnected() {
+ return connected;
+ }
+
+
+ @Override
+ public boolean isSessionOpen() {
+ return sessionOpen;
+ }
+
+
+ @Override
+ public boolean isAuthenticated() {
+ return authenticated;
+ }
+
+
@Override
public String getDefaultNickname(String username, String hostname, int port) {
if (port == DEFAULT_PORT) {
@@ -893,59 +969,21 @@
}
}
- public static Uri getUri(String input) {
- Matcher matcher = hostmask.matcher(input);
-
- if (!matcher.matches())
- return null;
-
- StringBuilder sb = new StringBuilder();
- sb.append(PROTOCOL)
- .append("://")
- .append(Uri.encode(matcher.group(1)))
- .append('@')
- .append(matcher.group(2));
- String portString = matcher.group(4);
- int port = DEFAULT_PORT;
-
- if (portString != null) {
- try {
- port = Integer.parseInt(portString);
- if (port < 1 || port > 65535) {
- port = DEFAULT_PORT;
- }
- }
- catch (NumberFormatException nfe) {
- // Keep the default port
- }
- }
+ @Override
+ public void getSelectionArgs(Uri uri, Map selection) {
+ selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
+ selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
+ selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());
+ int port = uri.getPort();
- if (port != DEFAULT_PORT) {
- sb.append(':')
- .append(port);
- }
+ if (port < 0)
+ port = DEFAULT_PORT;
- sb.append("/#")
- .append(Uri.encode(input));
- Uri uri = Uri.parse(sb.toString());
- return uri;
+ selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
+ selection.put(HostDatabase.FIELD_HOST_USERNAME, uri.getUserInfo());
}
- /**
- * Handle challenges from keyboard-interactive authentication mode.
- */
- public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo) {
- interactiveCanContinue = true;
- String[] responses = new String[numPrompts];
-
- for (int i = 0; i < numPrompts; i++) {
- // request response from user for each prompt
- responses[i] = bridge.promptHelper.requestPasswordPrompt(instruction, prompt[i]);
- }
-
- return responses;
- }
@Override
public HostBean createHost(Uri uri) {
@@ -972,40 +1010,37 @@
return host;
}
- @Override
- public void getSelectionArgs(Uri uri, Map selection) {
- selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
- selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
- selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());
- int port = uri.getPort();
- if (port < 0)
- port = DEFAULT_PORT;
-
- selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
- selection.put(HostDatabase.FIELD_HOST_USERNAME, uri.getUserInfo());
- }
-
- @Override
- public void setCompression(boolean compression) {
- this.compression = compression;
- }
-
- @Override
- public void setHttpproxy(String httpproxy) {
- this.httpproxy = httpproxy;
- }
-
- public static String getFormatHint(Context context) {
+ public String getFormatHint(Context context) {
return String.format("%s@%s:%s",
context.getString(R.string.format_username),
context.getString(R.string.format_hostname),
context.getString(R.string.format_port));
}
+
+ /**
+ * @return do we use the network
+ */
@Override
- public void setUseAuthAgent(String useAuthAgent) {
- this.useAuthAgent = useAuthAgent;
+ public boolean usesNetwork() {
+ return true;
+ }
+
+
+ /**
+ * Handle challenges from keyboard-interactive authentication mode.
+ */
+ public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo) {
+ interactiveCanContinue = true;
+ String[] responses = new String[numPrompts];
+
+ for (int i = 0; i < numPrompts; i++) {
+ // request response from user for each prompt
+ responses[i] = bridge.promptHelper.requestPasswordPrompt(instruction, prompt[i]);
+ }
+
+ return responses;
}
public Map retrieveIdentities() {
@@ -1103,11 +1138,4 @@
return true;
}
- /* (non-Javadoc)
- * @see com.five_ten_sg.connectbot.transport.AbsTransport#usesNetwork()
- */
- @Override
- public boolean usesNetwork() {
- return true;
- }
}
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/TN5250.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,436 @@
+/*
+ * 510ConnectBot
+ * Copyright 2014 Carl Byington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.five_ten_sg.connectbot.transport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.tn5250j.framework.tn5250.Screen5250;
+import org.tn5250j.framework.tn5250.tnvt;
+
+import com.five_ten_sg.connectbot.R;
+import com.five_ten_sg.connectbot.bean.HostBean;
+import com.five_ten_sg.connectbot.bean.PortForwardBean;
+import com.five_ten_sg.connectbot.service.TerminalBridge;
+import com.five_ten_sg.connectbot.service.TerminalKeyListener;
+import com.five_ten_sg.connectbot.service.TerminalManager;
+import com.five_ten_sg.connectbot.util.HostDatabase;
+import com.five_ten_sg.connectbot.util.PreferenceConstants;
+import android.content.Context;
+import android.net.Uri;
+import android.util.Log;
+import android.view.KeyCharacterMap;
+import android.view.KeyEvent;
+import android.view.View;
+import de.mud.terminal.vt320;
+
+
+/**
+ * @author Carl Byington
+ *
+ */
+public class TN5250 extends AbsTransport {
+ private static final String PROTOCOL = "tn5250";
+ private static final String TAG = "ConnectBot.tn5250";
+ private static final int DEFAULT_PORT = 23;
+
+ private Screen5250 screen52;
+ private tnvt handler = null;
+ private Socket socket;
+ private boolean connected = false;
+
+ static final Pattern hostmask;
+ static {
+ hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE);
+ }
+
+
+ class vt320x5250 extends vt320 {
+ private HashMap mnemonics;
+
+ public vt320x5250() {
+ this(80,24);
+ }
+
+ public vt320x5250(int width, int height) {
+ super(width, height);
+ mnemonics = new HashMap();
+ mnemonics.put(KEY_PAUSE , "[attn]");
+ mnemonics.put(KEY_F1 , "[pf1]");
+ mnemonics.put(KEY_F2 , "[pf2]");
+ mnemonics.put(KEY_F3 , "[pf3]");
+ mnemonics.put(KEY_F4 , "[pf4]");
+ mnemonics.put(KEY_F5 , "[pf5]");
+ mnemonics.put(KEY_F6 , "[pf6]");
+ mnemonics.put(KEY_F7 , "[pf7]");
+ mnemonics.put(KEY_F8 , "[pf8]");
+ mnemonics.put(KEY_F9 , "[pf9]");
+ mnemonics.put(KEY_F10 , "[pf10]");
+ mnemonics.put(KEY_F11 , "[pf11]");
+ mnemonics.put(KEY_F12 , "[pf12]");
+ mnemonics.put(KEY_UP , "[up]");
+ mnemonics.put(KEY_DOWN , "[down]");
+ mnemonics.put(KEY_LEFT , "[left]");
+ mnemonics.put(KEY_RIGHT , "[right]");
+ mnemonics.put(KEY_PAGE_DOWN , "[pgdown]");
+ mnemonics.put(KEY_PAGE_UP , "[pgup]");
+ mnemonics.put(KEY_INSERT , "[insert]");
+ mnemonics.put(KEY_DELETE , "[delete]");
+ mnemonics.put(KEY_BACK_SPACE , "[backspace]");
+ mnemonics.put(KEY_HOME , "[home]");
+ mnemonics.put(KEY_END , "[end]");
+ mnemonics.put(KEY_NUM_LOCK , "");
+ mnemonics.put(KEY_CAPS_LOCK , "");
+ mnemonics.put(KEY_SHIFT , "");
+ mnemonics.put(KEY_CONTROL , "");
+ mnemonics.put(KEY_ALT , "");
+ mnemonics.put(KEY_ENTER , "[enter]");
+ mnemonics.put(KEY_NUMPAD0 , "0");
+ mnemonics.put(KEY_NUMPAD1 , "1");
+ mnemonics.put(KEY_NUMPAD2 , "2");
+ mnemonics.put(KEY_NUMPAD3 , "3");
+ mnemonics.put(KEY_NUMPAD4 , "4");
+ mnemonics.put(KEY_NUMPAD5 , "5");
+ mnemonics.put(KEY_NUMPAD6 , "6");
+ mnemonics.put(KEY_NUMPAD7 , "7");
+ mnemonics.put(KEY_NUMPAD8 , "8");
+ mnemonics.put(KEY_NUMPAD9 , "9");
+ mnemonics.put(KEY_DECIMAL , ".");
+ mnemonics.put(KEY_ADD , "+");
+ mnemonics.put(KEY_ESCAPE , "");
+ mnemonics.put(KEY_TAB , "[tab]");
+ }
+
+ @Override
+ public void debug(String s) {
+ Log.d(TAG, s);
+ }
+
+ // monitor injecting a field
+ @Override
+ public void setField(int l, int c, char [] d) {
+ screen52.setField(l, c, d);
+ }
+
+ // terminal key listener sending to local screen
+ @Override
+ public void write(byte[] b) {
+ if (bridge.monitor != null) bridge.monitor.hostData(b);
+ screen52.sendKeys(new String(b));
+ }
+ @Override
+ public void write(int b) {
+ if (bridge.monitor != null) bridge.monitor.hostData(b);
+ screen52.sendKeys(new String(new byte[] {(byte)b}));
+ }
+ @Override
+ public void keyPressed(int keyCode, char keyChar, int modifiers) {
+ if (mnemonics.containsKey(keyCode)) {
+ String s = mnemonics.get(keyCode);
+ if (s != "") {
+ if (bridge.monitor != null) bridge.monitor.hostData(s.getBytes());
+ screen52.sendKeys(s);
+ }
+ }
+ }
+ // 5250 writing to the screen
+ // test for changed screen contents
+ @Override
+ public void testChanged() {
+ if (bridge.monitor != null) bridge.monitor.testChanged();
+ }
+ @Override
+ public void putChar(int c, int l, char ch, int attributes) {
+ if (bridge.monitor != null) bridge.monitor.screenChanged(l, c);
+ super.putChar(c, l, ch, attributes);
+ }
+ @Override
+ public void setCursorPosition(int c, int l) {
+ if (bridge.monitor != null) bridge.monitor.cursorMove(l, c);
+ super.setCursorPosition(c, l);
+ }
+ };
+
+
+ public TN5250() {
+ super();
+ }
+
+
+ /**
+ * @return protocol part of the URI
+ */
+ public static String getProtocolName() {
+ return PROTOCOL;
+ }
+
+
+ /**
+ * Encode the current transport into a URI that can be passed via intent calls.
+ * @return URI to host
+ */
+ public Uri getUri(String input) {
+ Matcher matcher = hostmask.matcher(input);
+
+ if (!matcher.matches())
+ return null;
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(PROTOCOL)
+ .append("://")
+ .append(matcher.group(1));
+ String portString = matcher.group(3);
+ int port = DEFAULT_PORT;
+
+ if (portString != null) {
+ try {
+ port = Integer.parseInt(portString);
+
+ if (port < 1 || port > 65535) {
+ port = DEFAULT_PORT;
+ }
+ }
+ catch (NumberFormatException nfe) {
+ // Keep the default port
+ }
+ }
+
+ if (port != DEFAULT_PORT) {
+ sb.append(':');
+ sb.append(port);
+ }
+
+ sb.append("/#")
+ .append(Uri.encode(input));
+ Uri uri = Uri.parse(sb.toString());
+ return uri;
+ }
+
+
+ /**
+ * Causes transport to connect to the target host. After connecting but before a
+ * session is started, must call back to {@link TerminalBridge#onConnected()}.
+ * After that call a session may be opened.
+ */
+ @Override
+ public void connect() {
+ screen52 = new Screen5250();
+ handler = new tnvt(screen52, true, false, bridge, manager);
+ String encryption = host.getEncryption5250();
+ if ((encryption == null) || (encryption.length() == 0)) encryption = "NONE";
+ handler.setSSLType(encryption);
+ screen52.setVT(handler);
+ screen52.setBuffer(buffer);
+ connected = handler.connect(host.getHostname(), host.getPort(), buffer);
+ if (connected) bridge.onConnected();
+ }
+
+
+ /**
+ * Checks if read() will block. If there are no bytes remaining in
+ * the underlying transport, return true.
+ */
+ @Override
+ public boolean willBlock() {
+ // we don't use a relay thread between the transport and the vt320 buffer
+ return true;
+ }
+
+
+ /**
+ * Reads from the transport. Transport must support reading into a byte array
+ * buffer at the start of offset and a maximum of
+ * length bytes. If the remote host disconnects, throw an
+ * {@link IOException}.
+ * @param buffer byte buffer to store read bytes into
+ * @param offset where to start writing in the buffer
+ * @param length maximum number of bytes to read
+ * @return number of bytes read
+ * @throws IOException when remote host disconnects
+ */
+ public int read(byte[] buffer, int offset, int length) throws IOException {
+ // we don't use a relay thread between the transport and the vt320 buffer
+ return 0;
+ }
+
+
+ /**
+ * Writes to the transport. If the host is not yet connected, simply return without
+ * doing anything. An {@link IOException} should be thrown if there is an error after
+ * connection.
+ * @param buffer bytes to write to transport
+ * @throws IOException when there is a problem writing after connection
+ */
+ public void write(byte[] buffer) throws IOException {
+ }
+
+
+ /**
+ * Writes to the transport. See {@link #write(byte[])} for behavior details.
+ * @param c character to write to the transport
+ * @throws IOException when there is a problem writing after connection
+ */
+ public void write(int c) throws IOException {
+ }
+
+
+ /**
+ * Flushes the write commands to the transport.
+ * @throws IOException when there is a problem writing after connection
+ */
+ public void flush() throws IOException {
+ }
+
+
+ /**
+ * Closes the connection to the terminal.
+ */
+ public void close() {
+ handler.disconnect();
+ connected = false;
+ bridge.dispatchDisconnect(false);
+ }
+
+
+ /**
+ * Tells the transport what dimensions the display is currently
+ * @param columns columns of text
+ * @param rows rows of text
+ * @param width width in pixels
+ * @param height height in pixels
+ */
+ @Override
+ public void setDimensions(int columns, int rows, int width, int height) {
+ // do nothing
+ }
+
+
+ @Override
+ public vt320 getTransportBuffer() {
+ buffer = new vt320x5250();
+ return setupTransportBuffer();
+ }
+
+
+ @Override
+ public int getDefaultPort() {
+ return DEFAULT_PORT;
+ }
+
+
+ @Override
+ public boolean isConnected() {
+ return connected;
+ }
+
+
+ @Override
+ public boolean isSessionOpen() {
+ return connected;
+ }
+
+
+ @Override
+ public boolean isAuthenticated() {
+ return connected;
+ }
+
+
+ @Override
+ public String getDefaultNickname(String username, String hostname, int port) {
+ if (port == DEFAULT_PORT) {
+ return String.format("%s", hostname);
+ }
+ else {
+ return String.format("%s:%d", hostname, port);
+ }
+ }
+
+
+ @Override
+ public void getSelectionArgs(Uri uri, Map selection) {
+ selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
+ selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
+ selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());
+ int port = uri.getPort();
+
+ if (port < 0)
+ port = DEFAULT_PORT;
+
+ selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
+ }
+
+
+ @Override
+ public HostBean createHost(Uri uri) {
+ HostBean host = new HostBean();
+ host.setProtocol(PROTOCOL);
+ host.setHostname(uri.getHost());
+ int port = uri.getPort();
+
+ if (port < 0)
+ port = DEFAULT_PORT;
+
+ host.setPort(port);
+ String nickname = uri.getFragment();
+
+ if (nickname == null || nickname.length() == 0) {
+ host.setNickname(getDefaultNickname(host.getUsername(),
+ host.getHostname(), host.getPort()));
+ }
+ else {
+ host.setNickname(uri.getFragment());
+ }
+
+ return host;
+ }
+
+
+ public String getFormatHint(Context context) {
+ return String.format("%s:%s",
+ context.getString(R.string.format_hostname),
+ context.getString(R.string.format_port));
+ }
+
+
+ @Override
+ public boolean usesNetwork() {
+ return true;
+ }
+
+
+ @Override
+ public boolean needsRelay() {
+ // we don't use a relay thread between the transport and the vt320 buffer
+ return false;
+ }
+
+ public TerminalKeyListener getTerminalKeyListener() {
+ return new TerminalKeyListener(manager, bridge, buffer, host.getEncoding());
+ }
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/Telnet.java
--- a/src/com/five_ten_sg/connectbot/transport/Telnet.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/Telnet.java Mon Jun 16 08:24:00 2014 -0700
@@ -33,11 +33,14 @@
import com.five_ten_sg.connectbot.service.TerminalBridge;
import com.five_ten_sg.connectbot.service.TerminalManager;
import com.five_ten_sg.connectbot.util.HostDatabase;
+
import android.content.Context;
import android.net.Uri;
import android.util.Log;
+
import de.mud.telnet.TelnetProtocolHandler;
+
/**
* Telnet transport implementation.
* Original idea from the JTA telnet package (de.mud.telnet)
@@ -48,18 +51,15 @@
public class Telnet extends AbsTransport {
private static final String TAG = "ConnectBot.Telnet";
private static final String PROTOCOL = "telnet";
-
private static final int DEFAULT_PORT = 23;
private TelnetProtocolHandler handler;
- private Socket socket;
-
- private InputStream is;
- private OutputStream os;
- private int width;
- private int height;
-
- private boolean connected = false;
+ private Socket socket;
+ private InputStream is;
+ private OutputStream os;
+ private int width;
+ private int height;
+ private boolean connected = false;
static final Pattern hostmask;
static {
@@ -105,19 +105,50 @@
};
}
- /**
- * @param host
- * @param bridge
- * @param manager
- */
- public Telnet(HostBean host, TerminalBridge bridge, TerminalManager manager) {
- super(host, bridge, manager);
- }
public static String getProtocolName() {
return PROTOCOL;
}
+
+ public Uri getUri(String input) {
+ Matcher matcher = hostmask.matcher(input);
+
+ if (!matcher.matches())
+ return null;
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(PROTOCOL)
+ .append("://")
+ .append(matcher.group(1));
+ String portString = matcher.group(3);
+ int port = DEFAULT_PORT;
+
+ if (portString != null) {
+ try {
+ port = Integer.parseInt(portString);
+
+ if (port < 1 || port > 65535) {
+ port = DEFAULT_PORT;
+ }
+ }
+ catch (NumberFormatException nfe) {
+ // Keep the default port
+ }
+ }
+
+ if (port != DEFAULT_PORT) {
+ sb.append(':');
+ sb.append(port);
+ }
+
+ sb.append("/#")
+ .append(Uri.encode(input));
+ Uri uri = Uri.parse(sb.toString());
+ return uri;
+ }
+
+
@Override
public void connect() {
try {
@@ -135,44 +166,6 @@
}
}
- @Override
- public void close() {
- connected = false;
-
- if (socket != null)
- try {
- socket.close();
- socket = null;
- }
- catch (IOException e) {
- Log.d(TAG, "Error closing telnet socket.", e);
- }
- }
-
- @Override
- public void flush() throws IOException {
- os.flush();
- }
-
- @Override
- public int getDefaultPort() {
- return DEFAULT_PORT;
- }
-
- @Override
- public boolean isConnected() {
- return connected;
- }
-
- @Override
- public boolean isSessionOpen() {
- return connected;
- }
-
- @Override
- public boolean isAuthenticated() {
- return isConnected();
- }
@Override
public boolean willBlock() {
@@ -184,6 +177,7 @@
}
}
+
@Override
public int read(byte[] buffer, int start, int len) throws IOException {
/* process all already read bytes */
@@ -220,6 +214,7 @@
return n;
}
+
@Override
public void write(byte[] buffer) throws IOException {
try {
@@ -231,6 +226,7 @@
}
}
+
@Override
public void write(int c) throws IOException {
try {
@@ -242,6 +238,28 @@
}
}
+
+ @Override
+ public void flush() throws IOException {
+ os.flush();
+ }
+
+
+ @Override
+ public void close() {
+ connected = false;
+
+ if (socket != null)
+ try {
+ socket.close();
+ socket = null;
+ }
+ catch (IOException e) {
+ Log.d(TAG, "Error closing telnet socket.", e);
+ }
+ }
+
+
@Override
public void setDimensions(int columns, int rows, int width, int height) {
try {
@@ -252,6 +270,28 @@
}
}
+
+ @Override
+ public int getDefaultPort() {
+ return DEFAULT_PORT;
+ }
+
+ @Override
+ public boolean isConnected() {
+ return connected;
+ }
+
+ @Override
+ public boolean isSessionOpen() {
+ return isConnected();
+ }
+
+ @Override
+ public boolean isAuthenticated() {
+ return isConnected();
+ }
+
+
@Override
public String getDefaultNickname(String username, String hostname, int port) {
if (port == DEFAULT_PORT) {
@@ -262,43 +302,21 @@
}
}
- public static Uri getUri(String input) {
- Matcher matcher = hostmask.matcher(input);
-
- if (!matcher.matches())
- return null;
-
- StringBuilder sb = new StringBuilder();
- sb.append(PROTOCOL)
- .append("://")
- .append(matcher.group(1));
- String portString = matcher.group(3);
- int port = DEFAULT_PORT;
-
- if (portString != null) {
- try {
- port = Integer.parseInt(portString);
- if (port < 1 || port > 65535) {
- port = DEFAULT_PORT;
- }
- }
- catch (NumberFormatException nfe) {
- // Keep the default port
- }
- }
+ @Override
+ public void getSelectionArgs(Uri uri, Map selection) {
+ selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
+ selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
+ selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());
+ int port = uri.getPort();
- if (port != DEFAULT_PORT) {
- sb.append(':');
- sb.append(port);
- }
+ if (port < 0)
+ port = DEFAULT_PORT;
- sb.append("/#")
- .append(Uri.encode(input));
- Uri uri = Uri.parse(sb.toString());
- return uri;
+ selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
}
+
@Override
public HostBean createHost(Uri uri) {
HostBean host = new HostBean();
@@ -323,28 +341,13 @@
return host;
}
- @Override
- public void getSelectionArgs(Uri uri, Map selection) {
- selection.put(HostDatabase.FIELD_HOST_PROTOCOL, PROTOCOL);
- selection.put(HostDatabase.FIELD_HOST_NICKNAME, uri.getFragment());
- selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());
- int port = uri.getPort();
- if (port < 0)
- port = DEFAULT_PORT;
-
- selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
- }
-
- public static String getFormatHint(Context context) {
+ public String getFormatHint(Context context) {
return String.format("%s:%s",
context.getString(R.string.format_hostname),
context.getString(R.string.format_port));
}
- /* (non-Javadoc)
- * @see com.five_ten_sg.connectbot.transport.AbsTransport#usesNetwork()
- */
@Override
public boolean usesNetwork() {
return true;
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/transport/TransportFactory.java
--- a/src/com/five_ten_sg/connectbot/transport/TransportFactory.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TransportFactory.java Mon Jun 16 08:24:00 2014 -0700
@@ -36,6 +36,7 @@
private static String[] transportNames = {
SSH.getProtocolName(),
+ TN5250.getProtocolName(),
Telnet.getProtocolName(),
Local.getProtocolName(),
};
@@ -48,6 +49,9 @@
if (SSH.getProtocolName().equals(protocol)) {
return new SSH();
}
+ else if (TN5250.getProtocolName().equals(protocol)) {
+ return new TN5250();
+ }
else if (Telnet.getProtocolName().equals(protocol)) {
return new Telnet();
}
@@ -59,21 +63,13 @@
}
}
- public static Uri getUri(String scheme, String input) {
+ public static Uri getUri(String protocol, String input) {
Log.d("TransportFactory", String.format(
- "Attempting to discover URI for scheme=%s on input=%s", scheme,
- input));
-
- if (SSH.getProtocolName().equals(scheme))
- return SSH.getUri(input);
- else if (Telnet.getProtocolName().equals(scheme))
- return Telnet.getUri(input);
- else if (Local.getProtocolName().equals(scheme)) {
- Log.d("TransportFactory", "Got to the local parsing area");
- return Local.getUri(input);
- }
- else
- return null;
+ "Attempting to discover URI for protocol=%s on input=%s",
+ protocol, input));
+ AbsTransport t = getTransport(protocol);
+ if (t == null) return null;
+ return t.getUri(input);
}
public static String[] getTransportNames() {
@@ -88,13 +84,9 @@
}
public static boolean canForwardPorts(String protocol) {
- // TODO uh, make this have less knowledge about its children
- if (SSH.getProtocolName().equals(protocol)) {
- return true;
- }
- else {
- return false;
- }
+ AbsTransport t = getTransport(protocol);
+ if (t == null) return false;
+ return t.canForwardPorts();
}
/**
@@ -103,18 +95,9 @@
* @return expanded format hint
*/
public static String getFormatHint(String protocol, Context context) {
- if (SSH.getProtocolName().equals(protocol)) {
- return SSH.getFormatHint(context);
- }
- else if (Telnet.getProtocolName().equals(protocol)) {
- return Telnet.getFormatHint(context);
- }
- else if (Local.getProtocolName().equals(protocol)) {
- return Local.getFormatHint(context);
- }
- else {
- return AbsTransport.getFormatHint(context);
- }
+ AbsTransport t = getTransport(protocol);
+ if (t == null) return "???";
+ return t.getFormatHint(context);
}
/**
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/util/Colors.java
--- a/src/com/five_ten_sg/connectbot/util/Colors.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/util/Colors.java Mon Jun 16 08:24:00 2014 -0700
@@ -23,22 +23,22 @@
*/
public class Colors {
public final static Integer[] defaults = new Integer[] {
- 0xff000000, // black
- 0xffcc0000, // red
- 0xff00cc00, // green
- 0xffcccc00, // brown
- 0xff0000cc, // blue
- 0xffcc00cc, // purple
- 0xff00cccc, // cyan
- 0xffcccccc, // light grey
- 0xff444444, // dark grey
- 0xffff4444, // light red
- 0xff44ff44, // light green
- 0xffffff44, // yellow
- 0xff4444ff, // light blue
- 0xffff44ff, // light purple
- 0xff44ffff, // light cyan
- 0xffffffff, // white
+ 0xff000000, // black // 0
+ 0xffcc0000, // red // 1
+ 0xff00cc00, // green // 2
+ 0xffcccc00, // brown // 3
+ 0xff0000cc, // blue // 4
+ 0xffcc00cc, // purple // 5
+ 0xff00cccc, // cyan // 6
+ 0xffcccccc, // light grey // 7
+ 0xff444444, // dark grey // 8
+ 0xffff4444, // light red // 9
+ 0xff44ff44, // light green // a
+ 0xffffff44, // yellow // b
+ 0xff4444ff, // light blue // c
+ 0xffff44ff, // light purple // d
+ 0xff44ffff, // light cyan // e
+ 0xffffffff, // white // f
0xff000000, 0xff00005f, 0xff000087, 0xff0000af, 0xff0000d7,
0xff0000ff, 0xff005f00, 0xff005f5f, 0xff005f87, 0xff005faf,
0xff005fd7, 0xff005fff, 0xff008700, 0xff00875f, 0xff008787,
diff -r b3d0d806cbe2 -r 01d939969b10 src/com/five_ten_sg/connectbot/util/HostDatabase.java
--- a/src/com/five_ten_sg/connectbot/util/HostDatabase.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/util/HostDatabase.java Mon Jun 16 08:24:00 2014 -0700
@@ -46,7 +46,7 @@
public final static String TAG = "ConnectBot.HostDatabase";
public final static String DB_NAME = "hosts";
- public final static int DB_VERSION = 25;
+ public final static int DB_VERSION = 26;
public final static String TABLE_HOSTS = "hosts";
public final static String FIELD_HOST_NICKNAME = "nickname";
@@ -73,6 +73,8 @@
public final static String FIELD_HOST_X11HOST = "x11host";
public final static String FIELD_HOST_X11PORT = "x11port";
public final static String FIELD_HOST_MONITOR = "monitor";
+ public final static String FIELD_HOST_EMULATION = "emulation";
+ public final static String FIELD_HOST_ENCRYPTION5250 = "encryption5250";
public final static String TABLE_PORTFORWARDS = "portforwards";
public final static String FIELD_PORTFORWARD_HOSTID = "hostid";
@@ -179,7 +181,9 @@
+ FIELD_HOST_WANTX11FORWARD + " TEXT DEFAULT '" + Boolean.toString(false) + "', "
+ FIELD_HOST_X11HOST + " TEXT DEFAULT '" + X11HOST_DEFAULT + "', "
+ FIELD_HOST_X11PORT + " INTEGER DEFAULT " + X11PORT_DEFAULT + ", "
- + FIELD_HOST_MONITOR + " TEXT)");
+ + FIELD_HOST_MONITOR + " TEXT, "
+ + FIELD_HOST_EMULATION + " TEXT, "
+ + FIELD_HOST_ENCRYPTION5250 + " TEXT)");
db.execSQL("CREATE TABLE " + TABLE_PORTFORWARDS
+ " (_id INTEGER PRIMARY KEY, "
+ FIELD_PORTFORWARD_HOSTID + " INTEGER, "
@@ -290,6 +294,12 @@
case 24:
db.execSQL("ALTER TABLE " + TABLE_HOSTS
+ " ADD COLUMN " + FIELD_HOST_MONITOR + " TEXT");
+
+ case 25:
+ db.execSQL("ALTER TABLE " + TABLE_HOSTS
+ + " ADD COLUMN " + FIELD_HOST_EMULATION + " TEXT");
+ db.execSQL("ALTER TABLE " + TABLE_HOSTS
+ + " ADD COLUMN " + FIELD_HOST_ENCRYPTION5250 + " TEXT");
}
}
@@ -403,7 +413,9 @@
COL_WANTX11FORWARD = c.getColumnIndexOrThrow(FIELD_HOST_WANTX11FORWARD),
COL_X11HOST = c.getColumnIndexOrThrow(FIELD_HOST_X11HOST),
COL_X11PORT = c.getColumnIndexOrThrow(FIELD_HOST_X11PORT),
- COL_MONITOR = c.getColumnIndexOrThrow(FIELD_HOST_MONITOR);
+ COL_MONITOR = c.getColumnIndexOrThrow(FIELD_HOST_MONITOR),
+ COL_EMULATION = c.getColumnIndexOrThrow(FIELD_HOST_EMULATION),
+ COL_ENCRYPTION5250 = c.getColumnIndexOrThrow(FIELD_HOST_ENCRYPTION5250);
while (c.moveToNext()) {
HostBean host = new HostBean();
@@ -430,6 +442,8 @@
host.setX11Host(c.getString(COL_X11HOST));
host.setX11Port(c.getInt(COL_X11PORT));
host.setMonitor(c.getString(COL_MONITOR));
+ host.setHostEmulation(c.getString(COL_EMULATION));
+ host.setEncryption5250(c.getString(COL_ENCRYPTION5250));
hosts.add(host);
}
diff -r b3d0d806cbe2 -r 01d939969b10 src/de/mud/terminal/VDUBuffer.java
--- a/src/de/mud/terminal/VDUBuffer.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/de/mud/terminal/VDUBuffer.java Mon Jun 16 08:24:00 2014 -0700
@@ -1,7 +1,7 @@
/*
* This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform".
*
- * (c) Matthias L. Jugel, Marcus Mei�ner 1996-2005. All Rights Reserved.
+ * (c) Matthias L. Jugel, Marcus Meißner 1996-2005. All Rights Reserved.
*
* Please visit http://javatelnet.org/ for updates and contact.
*
@@ -37,8 +37,8 @@
*/
public class VDUBuffer {
- /** The current version id tag */
- public final static String ID = "$Id: VDUBuffer.java 503 2005-10-24 07:34:13Z marcus $";
+ /** a generic display that should redraw on demand */
+ protected VDUDisplay display;
/** Enable debug messages. */
public final static int debug = 0;
@@ -99,11 +99,11 @@
/** how much to left shift the background color */
public final static int COLOR_BG_SHIFT = 14;
/** color mask */
- public final static int COLOR = 0x7fffe0; /* 0000 0000 0111 1111 1111 1111 1110 0000 */
+ public final static int COLOR = 0x7fffe0; /* 0000 0000 0111 1111 1111 1111 1110 0000 */
/** foreground color mask */
- public final static int COLOR_FG = 0x3fe0; /* 0000 0000 0000 0000 0011 1111 1110 0000 */
+ public final static int COLOR_FG = 0x003fe0; /* 0000 0000 0000 0000 0011 1111 1110 0000 */
/** background color mask */
- public final static int COLOR_BG = 0x7fc000; /* 0000 0000 0111 1111 1100 0000 0000 0000 */
+ public final static int COLOR_BG = 0x7fc000; /* 0000 0000 0111 1111 1100 0000 0000 0000 */
/**
* Create a new video display buffer with the passed width and height in
@@ -862,9 +862,6 @@
// return value;
// }
- /** a generic display that should redraw on demand */
- protected VDUDisplay display;
-
public void setDisplay(VDUDisplay display) {
this.display = display;
}
diff -r b3d0d806cbe2 -r 01d939969b10 src/de/mud/terminal/vt320.java
--- a/src/de/mud/terminal/vt320.java Tue Jun 03 08:48:14 2014 -0700
+++ b/src/de/mud/terminal/vt320.java Mon Jun 16 08:24:00 2014 -0700
@@ -39,12 +39,6 @@
*/
public abstract class vt320 extends VDUBuffer implements VDUInput {
- /** The current version id tag.
- * $Id: vt320.java 507 2005-10-25 10:14:52Z marcus $
- *
- */
- public final static String ID = "$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $";
-
/** the debug level */
private final static int debug = 0;
private StringBuilder debugStr;
@@ -72,12 +66,27 @@
}
/**
+ * inject field contents as if typed
+ */
+ public void setField(int l, int c, char [] d) {
+ // ignore line and column, just send the bytes to the host.
+ int n = d.length;
+ byte [] b = new byte [n];
+ for (int i=0; i> clazzes = new ArrayList>();
+
+
+ private BuiltInCodePageFactory() {
+ register();
+ }
+
+ public static synchronized final BuiltInCodePageFactory getInstance() {
+ if (singleton == null) {
+ singleton = new BuiltInCodePageFactory();
+ }
+ return singleton;
+ }
+
+ private void register() {
+ clazzes.add(CCSID37.class);
+ clazzes.add(CCSID273.class);
+ clazzes.add(CCSID277.class);
+ clazzes.add(CCSID278.class);
+ clazzes.add(CCSID280.class);
+ clazzes.add(CCSID284.class);
+ clazzes.add(CCSID285.class);
+ clazzes.add(CCSID297.class);
+ clazzes.add(CCSID424.class);
+ clazzes.add(CCSID500.class);
+ clazzes.add(CCSID870.class);
+ clazzes.add(CCSID871.class);
+ clazzes.add(CCSID875.class);
+ clazzes.add(CCSID1025.class);
+ clazzes.add(CCSID1026.class);
+ clazzes.add(CCSID1112.class);
+ clazzes.add(CCSID1140.class);
+ clazzes.add(CCSID1141.class);
+ clazzes.add(CCSID1147.class);
+ clazzes.add(CCSID1148.class);
+ }
+
+ /**
+ * @return unsorted list of available code pages
+ */
+ public String[] getAvailableCodePages() {
+ HashSet cpset = new HashSet();
+ for (Class> clazz : clazzes) {
+ final ICodepageConverter converter = getConverterFromClassName(clazz);
+ if (converter != null) {
+ cpset.add(converter.getName());
+ }
+ }
+ return cpset.toArray(new String[cpset.size()]);
+ }
+
+ /**
+ * @param encoding
+ * @return an {@link ICodePage} object OR null, of not found
+ */
+ public ICodePage getCodePage(String encoding) {
+ for (Class> clazz : clazzes) {
+ final ICodepageConverter converter = getConverterFromClassName(clazz);
+ if (converter != null && converter.getName().equals(encoding)) {
+ return converter;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Lazy loading converters takes time,
+ * but doesn't happen so often and saves memory.
+ *
+ * @param clazz {@link ICodepageConverter}
+ * @return
+ */
+ private ICodepageConverter getConverterFromClassName(Class> clazz) {
+ try {
+ final Constructor> constructor = clazz.getConstructor(new Class[0]);
+ final ICodepageConverter converter = (ICodepageConverter) constructor.newInstance();
+ converter.init();
+ return converter;
+ } catch (Exception e) {
+ Log.e(TAG,"Couldn't load code page converter class:" + clazz.getCanonicalName(), e);
+ return null;
+ }
+ }
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/CharMappings.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/CharMappings.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,85 @@
+/**
+ * Title: CharMappings.java
+ * Copyright: Copyright (c) 2001,2002,2003
+ * Company:
+ * @author Kenneth J. Pouncey
+ * rewritten by LDC, WVL, Luc
+ * @version 0.4
+ *
+ * Description:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Character Mappings for EBCDIC to ASCII and ASCII to EBCDIC translations
+ */
+public class CharMappings {
+
+ public static final String DFT_ENC = "37";
+ public static final int NATIVE_CP = 0;
+ public static final int TOOLBOX_CP = 1;
+
+ private static final HashMap map = new HashMap();
+
+ public static String[] getAvailableCodePages() {
+ Set cpset = new HashSet(); // no double entries
+ for (String cp : BuiltInCodePageFactory.getInstance().getAvailableCodePages()) {
+ cpset.add(cp);
+ }
+ for (String cp : ToolboxCodePageFactory.getInstance().getAvailableCodePages()) {
+ cpset.add(cp);
+ }
+ String[] cparray = cpset.toArray(new String[cpset.size()]);
+ Arrays.sort(cparray);
+ return cparray;
+ }
+
+ public static ICodePage getCodePage(String encoding) {
+ if (map.containsKey(encoding)) {
+ return map.get(encoding);
+ }
+
+ ICodePage cp = BuiltInCodePageFactory.getInstance().getCodePage(encoding);
+ if (cp != null) {
+ map.put(encoding, cp);
+ return cp;
+ }
+
+ cp = ToolboxCodePageFactory.getInstance().getCodePage(encoding);
+ if (cp != null) {
+ map.put(encoding, cp);
+ return cp;
+ }
+
+ cp = JavaCodePageFactory.getCodePage(encoding);
+ if (cp != null) {
+ map.put(encoding, cp);
+ return cp;
+ }
+
+ // unsupported codepage ==> return default
+ return BuiltInCodePageFactory.getInstance().getCodePage(DFT_ENC);
+ }
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/ICodePage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/ICodePage.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,22 @@
+package org.tn5250j.encoding;
+
+public interface ICodePage {
+
+ /**
+ * Convert a single byte (or maybe more bytes which representing one character) to a Unicode character.
+ *
+ * @param index
+ * @return
+ */
+ public abstract char ebcdic2uni(int index);
+
+ /**
+ * Convert a Unicode character in it's byte representation.
+ * Therefore, only 8bit codepages are supported.
+ *
+ * @param index
+ * @return
+ */
+ public abstract byte uni2ebcdic(char index);
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/JavaCodePageFactory.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/JavaCodePageFactory.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,94 @@
+/**
+ * Title: JavaCodePage
+ * Copyright: Copyright (c) 2001, 2002, 2003
+ * Company:
+ * @author LDC, WVL, Luc, master_jaf
+ * @version 0.4
+ *
+ * Description:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+
+/* package */ class JavaCodePageFactory extends AbstractCodePage {
+
+ private final CharsetEncoder encoder;
+ private final CharsetDecoder decoder;
+
+ /* package */ JavaCodePageFactory(String encoding, CharsetEncoder encoder, CharsetDecoder decoder) {
+ super(encoding);
+ this.encoder = encoder;
+ this.decoder = decoder;
+ }
+
+ /* (non-Javadoc)
+ * @see org.tn5250j.encoding.CodePage#ebcdic2uni(int)
+ */
+ @Override
+ public char ebcdic2uni(int codepoint) {
+ try {
+ final ByteBuffer in = ByteBuffer.wrap(new byte[] { (byte) codepoint });
+ final CharBuffer out = this.decoder.decode(in);
+ return out.get(0);
+ } catch (Exception cce) {
+ return ' ';
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.tn5250j.encoding.CodePage#uni2ebcdic(char)
+ */
+ @Override
+ public byte uni2ebcdic(char character) {
+ try {
+ final CharBuffer in = CharBuffer.wrap(new char[] {character});
+ final ByteBuffer out = this.encoder.encode(in);
+ return out.get(0);
+ } catch (Exception cce) {
+ return 0x0;
+ }
+ }
+
+ /**
+ * @param encoding
+ * @return A new {@link CodePage} object OR null, if not available.
+ */
+ /* package */ static ICodePage getCodePage(final String encoding) {
+ CharsetDecoder dec = null;
+ CharsetEncoder enc = null;
+ try {
+ final Charset cs = java.nio.charset.Charset.forName(encoding);
+ dec = cs.newDecoder();
+ enc = cs.newEncoder();
+ } catch (Exception e) {
+ enc = null;
+ dec = null;
+ }
+ if ((enc != null) && (dec != null)) {
+ return new JavaCodePageFactory(encoding, enc, dec);
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/ToolboxCodePageFactory.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/ToolboxCodePageFactory.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,156 @@
+/**
+ * Title: ToolboxCodePage
+ * Copyright: Copyright (c) 2001, 2002, 2003
+ * Company:
+ * @author Kenneth J. Pouncey
+ * rewritten by LDC, WVL, Luc
+ * @version 0.4
+ *
+ * Description:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import android.util.Log;
+
+
+class ToolboxCodePageFactory {
+ private static final String TAG = "ToolboxCodePageFactory";
+ private final static String[] CODEPAGES = { "Big5", "Cp037", "Cp273", "Cp277", "Cp278",
+ "Cp280", "Cp284", "Cp285", "Cp297", "Cp420", "Cp424", "Cp437",
+ "Cp500", "Cp737", "Cp775", "Cp838", "Cp850", "Cp852", "Cp855",
+ "Cp856", "Cp857", "Cp858", "Cp860", "Cp861", "Cp862", "Cp863",
+ "Cp864", "Cp865", "Cp866", "Cp868", "Cp869", "Cp870",
+ "Cp871", "Cp874", "Cp875", "Cp918", "Cp921", "Cp922",
+ "Cp923", // IBM Latin-9.
+ "Cp930", "Cp933", "Cp935", "Cp937", "Cp939", "Cp942", "Cp943",
+ "Cp948", "Cp949", "Cp950", "Cp964", "Cp970", "Cp1006", "Cp1025",
+ "Cp1026", "Cp1046", "Cp1097", "Cp1098", "Cp1112", "Cp1122",
+ "Cp1123", "Cp1124", "Cp1140", "Cp1141", "Cp1142", "Cp1143",
+ "Cp1144", "Cp1145", "Cp1146", "Cp1147", "Cp1148", "Cp1149",
+ "Cp1252", "Cp1250", "Cp1251", "Cp1253", "Cp1254", "Cp1255",
+ "Cp1256", "Cp1257", "Cp1258", "Cp1381", "Cp1383", "Cp33722" };
+
+ private static final String CONVERTER_NAME = "com.ibm.as400.access.CharConverter";
+ private static final String TOBYTES_NAME = "stringToByteArray";
+ private static final String TOSTRING_NAME = "byteArrayToString";
+
+ private static ToolboxCodePageFactory singleton;
+
+
+
+ private ToolboxCodePageFactory() {
+ /* private for singleton */
+ }
+
+ public static synchronized ToolboxCodePageFactory getInstance() {
+ if (singleton == null) {
+ singleton = new ToolboxCodePageFactory();
+ }
+ return singleton;
+ }
+
+ /**
+ * @return
+ */
+ public String[] getAvailableCodePages() {
+ try {
+ final ClassLoader loader = getClassLoader();
+ Class.forName(CONVERTER_NAME, false, loader);
+ return CODEPAGES;
+ } catch (Exception e) {
+ Log.i(TAG,"Couldn't locate JT400 Toolbox in classpath. Charset converters can't be used.");
+ return new String[0];
+ }
+ }
+
+ /**
+ * @param encoding
+ * @return
+ */
+ public ICodePage getCodePage(String encoding) {
+ try {
+ ClassLoader loader = getClassLoader();
+ Class> conv_class = Class.forName(CONVERTER_NAME, true, loader);
+ Constructor> conv_constructor = conv_class.getConstructor(new Class[] { String.class });
+ Method toBytes_method = conv_class.getMethod(TOBYTES_NAME, new Class[] { String.class });
+ Method toString_method = conv_class.getMethod(TOSTRING_NAME, new Class[] { byte[].class });
+ Object convobj = conv_constructor.newInstance(new Object[] { encoding });
+ return new ToolboxConverterProxy(convobj, toBytes_method, toString_method);
+ } catch (Exception e) {
+ Log.w(TAG,"Can't load charset converter from JT400 Toolbox for code page " + encoding, e);
+ return null;
+ }
+ }
+
+ private static final ClassLoader getClassLoader() {
+ ClassLoader loader = ToolboxCodePageFactory.class.getClassLoader();
+ if (loader == null) {
+ loader = ClassLoader.getSystemClassLoader();
+ }
+ return loader;
+ }
+
+ private static class ToolboxConverterProxy implements ICodePage {
+
+ private final Object converter;
+ private final Method tobytesMethod;
+ private final Method tostringMethod;
+
+ private ToolboxConverterProxy(Object converterObject, Method tobytesMethod, Method tostringMethod) {
+ super();
+ this.converter = converterObject;
+ this.tobytesMethod = tobytesMethod;
+ this.tostringMethod = tostringMethod;
+ }
+
+ @Override
+ public char ebcdic2uni(int index) {
+ Object result;
+ try {
+ result = tostringMethod.invoke(converter, new Object[] { new byte[] { (byte) (index & 0xFF) } });
+ } catch (Throwable t) {
+ result = null;
+ }
+
+ if (result == null)
+ return 0x00;
+
+ return ((String) result).charAt(0);
+ }
+
+ @Override
+ public byte uni2ebcdic(char index) {
+ Object result;
+ try {
+ result = tobytesMethod.invoke(converter, new Object[] { new String(new char[] { index }) });
+ } catch (Throwable t) {
+ result = null;
+ }
+
+ if (result == null)
+ return 0x00;
+
+ return ((byte[]) result)[0];
+ }
+ }
+
+}
\ No newline at end of file
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1025.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1025.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1025<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1025.jsp
+ */
+public final class CCSID1025 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1025";
+ public final static String DESCR = "Cyrillic Multilingual";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u0452',
+ '\u0453', '\u0451', '\u0454', '\u0455', '\u0456', '\u0457',
+ '\u0458', '[', '.', '<', '(', '+', '!', '&', '\u0459', '\u045A',
+ '\u045B', '\u045C', '\u045E', '\u045F', '\u042A', '\u2116',
+ '\u0402', ']', '$', '*', ')', ';', '^', '-', '/', '\u0403',
+ '\u0401', '\u0404', '\u0405', '\u0406', '\u0407', '\u0408',
+ '\u0409', '|', ',', '%', '_', '>', '?', '\u040A', '\u040B',
+ '\u040C', '\u00AD', '\u040E', '\u040F', '\u044E', '\u0430',
+ '\u0431', '`', ':', '#', '@', '\'', '=', '"', '\u0446', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u0434', '\u0435', '\u0444',
+ '\u0433', '\u0445', '\u0438', '\u0439', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', '\u043A', '\u043B', '\u043C', '\u043D',
+ '\u043E', '\u043F', '\u044F', '~', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u0440', '\u0441', '\u0442', '\u0443', '\u0436',
+ '\u0432', '\u044C', '\u044B', '\u0437', '\u0448', '\u044D',
+ '\u0449', '\u0447', '\u044A', '\u042E', '\u0410', '\u0411',
+ '\u0426', '\u0414', '\u0415', '\u0424', '\u0413', '{', 'A', 'B',
+ 'C', 'D', 'E', 'F', 'G', 'H', 'I', '\u0425', '\u0418', '\u0419',
+ '\u041A', '\u041B', '\u041C', '}', 'J', 'K', 'L', 'M', 'N', 'O',
+ 'P', 'Q', 'R', '\u041D', '\u041E', '\u041F', '\u042F', '\u0420',
+ '\u0421', '\\', '\u00A7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '\u0422', '\u0423', '\u0416', '\u0412', '\u042C', '\u042B', '0',
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '\u0417', '\u0428',
+ '\u042D', '\u0429', '\u0427', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1026.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1026.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1026<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1026.jsp
+ */
+public final class CCSID1026 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1026";
+ public final static String DESCR = "Turkey Latin 5";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '{', '\u00F1',
+ '\u00C7', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC',
+ '\u00DF', '\u011E', '\u0130', '*', ')', ';', '^', '-', '/',
+ '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5', '[',
+ '\u00D1', '\u015F', ',', '%', '_', '>', '?', '\u00F8', '\u00C9',
+ '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF',
+ '\u00CC', '\u0131', ':', '\u00D6', '\u015E', '\'', '=', '\u00DC',
+ '\u00D8', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB',
+ '\u00BB', '}', '`', '\u00A6', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6',
+ '\u00B8', '\u00C6', '\u00A4', '\u00B5', '\u00F6', 's', 't', 'u',
+ 'v', 'w', 'x', 'y', 'z', '\u00A1', '\u00BF', ']', '$', '@',
+ '\u00AE', '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|',
+ '\u00AF', '\u00A8', '\u00B4', '\u00D7', '\u00E7', 'A', 'B', 'C',
+ 'D', 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '~', '\u00F2',
+ '\u00F3', '\u00F5', '\u011F', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 'Q', 'R', '\u00B9', '\u00FB', '\\', '\u00F9', '\u00FA', '\u00FF',
+ '\u00FC', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '\u00B2', '\u00D4', '#', '\u00D2', '\u00D3', '\u00D5', '0', '1',
+ '2', '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '"',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1112.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1112.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1112<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1112.jsp
+ */
+public final class CCSID1112 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1112";
+ public final static String DESCR = "Baltic, Multilingual";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u0161',
+ '\u00E4', '\u0105', '\u012F', '\u016B', '\u00E5', '\u0113',
+ '\u017E', '\u00A2', '.', '<', '(', '+', '|', '&', '\u00E9',
+ '\u0119', '\u0117', '\u010D', '\u0173', '\u201E', '\u201C',
+ '\u0123', '\u00DF', '!', '$', '*', ')', ';', '\u00AC', '-', '/',
+ '\u0160', '\u00C4', '\u0104', '\u012E', '\u016A', '\u00C5',
+ '\u0112', '\u017D', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
+ '\u00C9', '\u0118', '\u0116', '\u010C', '\u0172', '\u012A',
+ '\u013B', '\u0122', '`', ':', '#', '@', '\'', '=', '"', '\u00D8',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
+ '\u0101', '\u017C', '\u0144', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u0156', '\u0157', '\u00E6',
+ '\u0137', '\u00C6', '\u00A4', '\u00B5', '~', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '\u201D', '\u017A', '\u0100', '\u017B',
+ '\u0143', '\u00AE', '^', '\u00A3', '\u012B', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '[', ']',
+ '\u0179', '\u0136', '\u013C', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u014D', '\u00F6', '\u0146',
+ '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u0107', '\u00FC', '\u0142', '\u015B', '\u2019',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u014C', '\u00D6', '\u0145', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u0106', '\u00DC',
+ '\u0141', '\u015A', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1140.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1140.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1140<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1140.jsp
+ */
+public final class CCSID1140 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1140";
+ public final static String DESCR = "ECECP: USA, Canada, Netherlands, Portugal, Brazil, Australia, New Zealand";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '\u00A2', '.', '<', '(', '+', '|', '&', '\u00E9',
+ '\u00EA', '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF',
+ '\u00EC', '\u00DF', '!', '$', '*', ')', ';', '\u00AC', '-', '/',
+ '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5',
+ '\u00C7', '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
+ '\u00C9', '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE',
+ '\u00CF', '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
+ '\u00F0', '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6',
+ '\u00B8', '\u00C6', '\u20AC', '\u00B5', '~', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD',
+ '\u00DE', '\u00AE', '^', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '[', ']',
+ '\u00AF', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2',
+ '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1141.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1141.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1141<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1141.jsp
+ */
+public final class CCSID1141 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1141";
+ public final static String DESCR = "ECECP: Austria, Germany";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '{', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7', '\u00F1',
+ '\u00C4', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '~',
+ '\u00DC', '$', '*', ')', ';', '^', '-', '/', '\u00C2', '[',
+ '\u00C0', '\u00C1', '\u00C3', '\u00C5', '\u00C7', '\u00D1',
+ '\u00F6', ',', '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA',
+ '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '`',
+ ':', '#', '\u00A7', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6',
+ '\u20AC', '\u00B5', '\u00DF', 's', 't', 'u', 'v', 'w', 'x', 'y',
+ 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE',
+ '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9', '@', '\u00B6',
+ '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF', '\u00A8',
+ '\u00B4', '\u00D7', '\u00E4', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+ 'H', 'I', '\u00AD', '\u00F4', '\u00A6', '\u00F2', '\u00F3',
+ '\u00F5', '\u00FC', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '}', '\u00F9', '\u00FA', '\u00FF', '\u00D6',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\\', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3',
+ '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', ']', '\u00D9',
+ '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1147.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1147.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1147<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1147.jsp
+ */
+public final class CCSID1147 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1147";
+ public final static String DESCR = "ECECP: France";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '@', '\u00E1', '\u00E3', '\u00E5', '\\', '\u00F1',
+ '\u00B0', '.', '<', '(', '+', '!', '&', '{', '\u00EA', '\u00EB',
+ '}', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '\u00DF', '\u00A7',
+ '$', '*', ')', ';', '^', '-', '/', '\u00C2', '\u00C4', '\u00C0',
+ '\u00C1', '\u00C3', '\u00C5', '\u00C7', '\u00D1', '\u00F9', ',',
+ '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA', '\u00CB',
+ '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '\u00B5', ':',
+ '\u00A3', '\u00E0', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '[', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
+ 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6', '\u20AC',
+ '`', '\u00A8', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\u00A1',
+ '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE', '\u00A2', '#',
+ '\u00A5', '\u00B7', '\u00A9', ']', '\u00B6', '\u00BC', '\u00BD',
+ '\u00BE', '\u00AC', '|', '\u00AF', '~', '\u00B4', '\u00D7',
+ '\u00E9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', '\u00AD',
+ '\u00F4', '\u00F6', '\u00F2', '\u00F3', '\u00F5', '\u00E8', 'J',
+ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', '\u00B9', '\u00FB',
+ '\u00FC', '\u00A6', '\u00FA', '\u00FF', '\u00E7', '\u00F7', 'S',
+ 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2', '\u00D4', '\u00D6',
+ '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3', '4', '5', '6',
+ '7', '8', '9', '\u00B3', '\u00DB', '\u00DC', '\u00D9', '\u00DA',
+ '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID1148.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID1148.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 1148<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid1148.jsp
+ */
+public final class CCSID1148 extends CodepageConverterAdapter {
+
+ public final static String NAME = "1148";
+ public final static String DESCR = "ECECP: International 1";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '[', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC',
+ '\u00DF', ']', '$', '*', ')', ';', '^', '-', '/', '\u00C2',
+ '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5', '\u00C7',
+ '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8', '\u00C9',
+ '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF',
+ '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0',
+ '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8',
+ '\u00C6', '\u20AC', '\u00B5', '~', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE',
+ '\u00AE', '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|',
+ '\u00AF', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2',
+ '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID273.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID273.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,97 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 273<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid273.jsp
+ */
+public final class CCSID273 extends CodepageConverterAdapter {
+
+ public final static String NAME = "273";
+ public final static String DESCR = "CECP: Austria, Germany";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '{', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7', '\u00F1',
+ '\u00C4', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '~',
+ '\u00DC', '$', '*', ')', ';', '^', '-', '/', '\u00C2', '[',
+ '\u00C0', '\u00C1', '\u00C3', '\u00C5', '\u00C7', '\u00D1',
+ '\u00F6', ',', '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA',
+ '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '`',
+ ':', '#', '\u00A7', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6',
+ '\u00A4', '\u00B5', '\u00DF', 's', 't', 'u', 'v', 'w', 'x', 'y',
+ 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE',
+ '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9', '@', '\u00B6',
+ '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF', '\u00A8',
+ '\u00B4', '\u00D7', '\u00E4', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+ 'H', 'I', '\u00AD', '\u00F4', '\u00A6', '\u00F2', '\u00F3',
+ '\u00F5', '\u00FC', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '}', '\u00F9', '\u00FA', '\u00FF', '\u00D6',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\\', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3',
+ '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', ']', '\u00D9',
+ '\u00DA', '\u009F', };
+
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID277.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID277.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 277<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid277.jsp
+ */
+public final class CCSID277 extends CodepageConverterAdapter {
+
+ public final static String NAME = "277";
+ public final static String DESCR = "CECP: Denmark, Norway";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '}', '\u00E7', '\u00F1',
+ '#', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA', '\u00EB',
+ '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '\u00DF',
+ '\u00A4', '\u00C5', '*', ')', ';', '^', '-', '/', '\u00C2',
+ '\u00C4', '\u00C0', '\u00C1', '\u00C3', '$', '\u00C7', '\u00D1',
+ '\u00F8', ',', '%', '_', '>', '?', '\u00A6', '\u00C9', '\u00CA',
+ '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '`',
+ ':', '\u00C6', '\u00D8', '\'', '=', '"', '@', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', '\u00AA', '\u00BA', '{', '\u00B8', '[', ']', '\u00B5',
+ '\u00FC', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\u00A1',
+ '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE', '\u00A2',
+ '\u00A3', '\u00A5', '\u00B7', '\u00A9', '\u00A7', '\u00B6',
+ '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF', '\u00A8',
+ '\u00B4', '\u00D7', '\u00E6', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+ 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2', '\u00F3',
+ '\u00F5', '\u00E5', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '~', '\u00F9', '\u00FA', '\u00FF', '\\',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID278.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID278.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 278<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid278.jsp
+ */
+public final class CCSID278 extends CodepageConverterAdapter {
+
+ public final static String NAME = "278";
+ public final static String DESCR = "CECP: Finland, Sweden";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '{', '\u00E0', '\u00E1', '\u00E3', '}', '\u00E7', '\u00F1',
+ '\u00A7', '.', '<', '(', '+', '!', '&', '`', '\u00EA', '\u00EB',
+ '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '\u00DF',
+ '\u00A4', '\u00C5', '*', ')', ';', '^', '-', '/', '\u00C2', '#',
+ '\u00C0', '\u00C1', '\u00C3', '$', '\u00C7', '\u00D1', '\u00F6',
+ ',', '%', '_', '>', '?', '\u00F8', '\\', '\u00CA', '\u00CB',
+ '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '\u00E9', ':',
+ '\u00C4', '\u00D6', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6', ']',
+ '\u00B5', '\u00FC', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE',
+ '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9', '[', '\u00B6',
+ '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF', '\u00A8',
+ '\u00B4', '\u00D7', '\u00E4', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+ 'H', 'I', '\u00AD', '\u00F4', '\u00A6', '\u00F2', '\u00F3',
+ '\u00F5', '\u00E5', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '~', '\u00F9', '\u00FA', '\u00FF', '\u00C9',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '@', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3',
+ '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F' };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID280.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID280.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 280<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid280.jsp
+ */
+public final class CCSID280 extends CodepageConverterAdapter {
+
+ public final static String NAME = "280";
+ public final static String DESCR = "CECP: Italy";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '{', '\u00E1', '\u00E3', '\u00E5', '\\', '\u00F1',
+ '\u00B0', '.', '<', '(', '+', '!', '&', ']', '\u00EA', '\u00EB',
+ '}', '\u00ED', '\u00EE', '\u00EF', '~', '\u00DF', '\u00E9', '$',
+ '*', ')', ';', '^', '-', '/', '\u00C2', '\u00C4', '\u00C0',
+ '\u00C1', '\u00C3', '\u00C5', '\u00C7', '\u00D1', '\u00F2', ',',
+ '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA', '\u00CB',
+ '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '\u00F9', ':',
+ '\u00A3', '\u00A7', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '[', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
+ 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6', '\u00A4',
+ '\u00B5', '\u00EC', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE',
+ '\u00A2', '#', '\u00A5', '\u00B7', '\u00A9', '@', '\u00B6',
+ '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF', '\u00A8',
+ '\u00B4', '\u00D7', '\u00E0', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+ 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00A6', '\u00F3',
+ '\u00F5', '\u00E8', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '\u00FC', '`', '\u00FA', '\u00FF', '\u00E7',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F' };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID284.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID284.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 284<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid284.jsp
+ */
+public final class CCSID284 extends CodepageConverterAdapter {
+
+ public final static String NAME = "284";
+ public final static String DESCR = "CECP: Spain, Latin America (Spanish)";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00A6', '[', '.', '<', '(', '+', '|', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC',
+ '\u00DF', ']', '$', '*', ')', ';', '\u00AC', '-', '/', '\u00C2',
+ '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5', '\u00C7', '#',
+ '\u00F1', ',', '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA',
+ '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '`',
+ ':', '\u00D1', '@', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6',
+ '\u00A4', '\u00B5', '\u00A8', 's', 't', 'u', 'v', 'w', 'x', 'y',
+ 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE',
+ '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9', '\u00A7',
+ '\u00B6', '\u00BC', '\u00BD', '\u00BE', '^', '!', '\u00AF', '~',
+ '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2', '\u00F3', '\u00F5',
+ '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', '\u00B9',
+ '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF', '\\', '\u00F7',
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2', '\u00D4',
+ '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3', '4',
+ '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC', '\u00D9',
+ '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID285.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID285.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 285<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid285.jsp
+ */
+public final class CCSID285 extends CodepageConverterAdapter {
+
+ public final static String NAME = "285";
+ public final static String DESCR = "CECP: United Kingdom";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '$', '.', '<', '(', '+', '|', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC',
+ '\u00DF', '!', '\u00A3', '*', ')', ';', '\u00AC', '-', '/',
+ '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5',
+ '\u00C7', '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
+ '\u00C9', '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE',
+ '\u00CF', '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
+ '\u00F0', '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6',
+ '\u00B8', '\u00C6', '\u00A4', '\u00B5', '\u00AF', 's', 't', 'u',
+ 'v', 'w', 'x', 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD',
+ '\u00DE', '\u00AE', '\u00A2', '[', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '^', ']', '~',
+ '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D', 'E', 'F',
+ 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2', '\u00F3',
+ '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF', '\\',
+ '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID297.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID297.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 297<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid297.jsp
+ */
+public final class CCSID297 extends CodepageConverterAdapter {
+
+ public final static String NAME = "297";
+ public final static String DESCR = "CECP: France";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '@', '\u00E1', '\u00E3', '\u00E5', '\\', '\u00F1',
+ '\u00B0', '.', '<', '(', '+', '!', '&', '{', '\u00EA', '\u00EB',
+ '}', '\u00ED', '\u00EE', '\u00EF', '\u00EC', '\u00DF', '\u00A7',
+ '$', '*', ')', ';', '^', '-', '/', '\u00C2', '\u00C4', '\u00C0',
+ '\u00C1', '\u00C3', '\u00C5', '\u00C7', '\u00D1', '\u00F9', ',',
+ '%', '_', '>', '?', '\u00F8', '\u00C9', '\u00CA', '\u00CB',
+ '\u00C8', '\u00CD', '\u00CE', '\u00CF', '\u00CC', '\u00B5', ':',
+ '\u00A3', '\u00E0', '\'', '=', '"', '\u00D8', 'a', 'b', 'c', 'd',
+ 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0', '\u00FD',
+ '\u00FE', '\u00B1', '[', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
+ 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8', '\u00C6', '\u00A4',
+ '`', '\u00A8', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\u00A1',
+ '\u00BF', '\u00D0', '\u00DD', '\u00DE', '\u00AE', '\u00A2', '#',
+ '\u00A5', '\u00B7', '\u00A9', ']', '\u00B6', '\u00BC', '\u00BD',
+ '\u00BE', '\u00AC', '|', '\u00AF', '~', '\u00B4', '\u00D7',
+ '\u00E9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', '\u00AD',
+ '\u00F4', '\u00F6', '\u00F2', '\u00F3', '\u00F5', '\u00E8', 'J',
+ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', '\u00B9', '\u00FB',
+ '\u00FC', '\u00A6', '\u00FA', '\u00FF', '\u00E7', '\u00F7', 'S',
+ 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2', '\u00D4', '\u00D6',
+ '\u00D2', '\u00D3', '\u00D5', '0', '1', '2', '3', '4', '5', '6',
+ '7', '8', '9', '\u00B3', '\u00DB', '\u00DC', '\u00D9', '\u00DA',
+ '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID37.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID37.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,98 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 37<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid37.jsp
+ */
+public final class CCSID37 extends CodepageConverterAdapter {
+
+ public final static String NAME = "37";
+ public final static String DESCR = "CECP: USA, Canada (ESA*), Netherlands, Portugal, Brazil, Australia, New Zealand";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '\u00A2', '.', '<', '(', '+', '|', '&', '\u00E9',
+ '\u00EA', '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF',
+ '\u00EC', '\u00DF', '!', '$', '*', ')', ';', '\u00AC', '-', '/',
+ '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5',
+ '\u00C7', '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
+ '\u00C9', '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE',
+ '\u00CF', '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
+ '\u00F0', '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6',
+ '\u00B8', '\u00C6', '\u00A4', '\u00B5', '~', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD',
+ '\u00DE', '\u00AE', '^', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '[', ']',
+ '\u00AF', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2',
+ '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID424.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID424.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 424<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid424.jsp
+ */
+public final class CCSID424 extends CodepageConverterAdapter {
+
+ public final static String NAME = "424";
+ public final static String DESCR = "Hebrew";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u05D0', '\u05D1',
+ '\u05D2', '\u05D3', '\u05D4', '\u05D5', '\u05D6', '\u05D7',
+ '\u05D8', '\u00A2', '.', '<', '(', '+', '|', '&', '\u05D9',
+ '\u05DA', '\u05DB', '\u05DC', '\u05DD', '\u05DE', '\u05DF',
+ '\u05E0', '\u05E1', '!', '$', '*', ')', ';', '\u00AC', '-', '/',
+ '\u05E2', '\u05E3', '\u05E4', '\u05E5', '\u05E6', '\u05E7',
+ '\u05E8', '\u05E9', '\u00A6', ',', '%', '_', '>', '?', '\u001A',
+ '\u05EA', '\u001A', '\u001A', '\u00A0', '\u001A', '\u001A',
+ '\u001A', '\u2017', '`', ':', '#', '@', '\'', '=', '"', '\u001A',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
+ '\u001A', '\u001A', '\u001A', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u001A', '\u001A', '\u20AC',
+ '\u00B8', '\u20AA', '\u00A4', '\u00B5', '~', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '\u001A', '\u001A', '\u001A', '\u001A',
+ '\u001A', '\u00AE', '^', '\u00A3', '\u00A5', '\u2022', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '[', ']',
+ '\u203E', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u001A', '\u001A', '\u001A',
+ '\u001A', '\u001A', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u202D', '\u202E', '\u202C', '\u001A', '\u001A',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u001A', '\u001A', '\u001A', '\u001A', '\u001A', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u202A', '\u202B',
+ '\u200E', '\u200F', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID500.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID500.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 500<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid500.jsp
+ */
+public final class CCSID500 extends CodepageConverterAdapter {
+
+ public final static String NAME = "500";
+ public final static String DESCR = "CECP: Belgium, Canada (AS/400*), Switzerland, International Latin-1";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '[', '.', '<', '(', '+', '!', '&', '\u00E9', '\u00EA',
+ '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF', '\u00EC',
+ '\u00DF', ']', '$', '*', ')', ';', '^', '-', '/', '\u00C2',
+ '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5', '\u00C7',
+ '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8', '\u00C9',
+ '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE', '\u00CF',
+ '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB', '\u00F0',
+ '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6', '\u00B8',
+ '\u00C6', '\u00A4', '\u00B5', '~', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD', '\u00DE',
+ '\u00AE', '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
+ '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|',
+ '\u00AF', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2',
+ '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+ 'R', '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
+ '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
+ '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
+ '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID870.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID870.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 870<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid870.jsp
+ */
+public final class CCSID870 extends CodepageConverterAdapter {
+
+ public final static String NAME = "870";
+ public final static String DESCR = "Latin 2 - EBCDIC Multilingual";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u0163', '\u00E1', '\u0103', '\u010D', '\u00E7',
+ '\u0107', '[', '.', '<', '(', '+', '!', '&', '\u00E9', '\u0119',
+ '\u00EB', '\u016F', '\u00ED', '\u00EE', '\u013E', '\u013A',
+ '\u00DF', ']', '$', '*', ')', ';', '^', '-', '/', '\u00C2',
+ '\u00C4', '\u02DD', '\u00C1', '\u0102', '\u010C', '\u00C7',
+ '\u0106', '|', ',', '%', '_', '>', '?', '\u02C7', '\u00C9',
+ '\u0118', '\u00CB', '\u016E', '\u00CD', '\u00CE', '\u013D',
+ '\u0139', '`', ':', '#', '@', '\'', '=', '"', '\u02D8', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u015B', '\u0148', '\u0111',
+ '\u00FD', '\u0159', '\u015F', '\u00B0', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', '\u0142', '\u0144', '\u0161', '\u00B8',
+ '\u02DB', '\u00A4', '\u0105', '~', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u015A', '\u0147', '\u0110', '\u00DD', '\u0158',
+ '\u015E', '\u02D9', '\u0104', '\u017C', '\u0162', '\u017B',
+ '\u00A7', '\u017E', '\u017A', '\u017D', '\u0179', '\u0141',
+ '\u0143', '\u0160', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B',
+ 'C', 'D', 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6',
+ '\u0155', '\u00F3', '\u0151', '}', 'J', 'K', 'L', 'M', 'N', 'O',
+ 'P', 'Q', 'R', '\u011A', '\u0171', '\u00FC', '\u0165', '\u00FA',
+ '\u011B', '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '\u010F', '\u00D4', '\u00D6', '\u0154', '\u00D3', '\u0150', '0',
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '\u010E', '\u0170',
+ '\u00DC', '\u0164', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID871.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID871.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 871<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid871.jsp
+ */
+public final class CCSID871 extends CodepageConverterAdapter {
+
+ public final static String NAME = "871";
+ public final static String DESCR = "CECP: Iceland";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
+ '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
+ '\u00F1', '\u00DE', '.', '<', '(', '+', '!', '&', '\u00E9',
+ '\u00EA', '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF',
+ '\u00EC', '\u00DF', '\u00C6', '$', '*', ')', ';', '\u00D6', '-',
+ '/', '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5',
+ '\u00C7', '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
+ '\u00C9', '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE',
+ '\u00CF', '\u00CC', '\u00F0', ':', '#', '\u00D0', '\'', '=', '"',
+ '\u00D8', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB',
+ '\u00BB', '`', '\u00FD', '{', '\u00B1', '\u00B0', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '}', '\u00B8',
+ ']', '\u00A4', '\u00B5', '\u00F6', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u00A1', '\u00BF', '@', '\u00DD', '[', '\u00AE',
+ '\u00A2', '\u00A3', '\u00A5', '\u00B7', '\u00A9', '\u00A7',
+ '\u00B6', '\u00BC', '\u00BD', '\u00BE', '\u00AC', '|', '\u00AF',
+ '\u00A8', '\\', '\u00D7', '\u00FE', 'A', 'B', 'C', 'D', 'E', 'F',
+ 'G', 'H', 'I', '\u00AD', '\u00F4', '~', '\u00F2', '\u00F3',
+ '\u00F5', '\u00E6', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+ '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
+ '\u00B4', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '\u00B2', '\u00D4', '^', '\u00D2', '\u00D3', '\u00D5', '0', '1',
+ '2', '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB',
+ '\u00DC', '\u00D9', '\u00DA', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CCSID875.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CCSID875.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ * Alternative (extended) implementation of a codepage converter CCSID 875<->Unicode.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+/**
+ * @author master_jaf
+ * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid875.jsp
+ */
+public final class CCSID875 extends CodepageConverterAdapter {
+
+ public final static String NAME = "875";
+ public final static String DESCR = "Greek";
+
+ /*
+ * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
+ * covered by any license, this should legal.
+ */
+ private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
+ '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
+ '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
+ '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
+ '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
+ '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
+ '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
+ '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
+ '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
+ '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
+ '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u0391', '\u0392',
+ '\u0393', '\u0394', '\u0395', '\u0396', '\u0397', '\u0398',
+ '\u0399', '[', '.', '<', '(', '+', '!', '&', '\u039A', '\u039B',
+ '\u039C', '\u039D', '\u039E', '\u039F', '\u03A0', '\u03A1',
+ '\u03A3', ']', '$', '*', ')', ';', '^', '-', '/', '\u03A4',
+ '\u03A5', '\u03A6', '\u03A7', '\u03A8', '\u03A9', '\u03AA',
+ '\u03AB', '|', ',', '%', '_', '>', '?', '\u00A8', '\u0386',
+ '\u0388', '\u0389', '\u00A0', '\u038A', '\u038C', '\u038E',
+ '\u038F', '`', ':', '#', '@', '\'', '=', '"', '\u0385', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u03B1', '\u03B2', '\u03B3',
+ '\u03B4', '\u03B5', '\u03B6', '\u00B0', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', '\u03B7', '\u03B8', '\u03B9', '\u03BA',
+ '\u03BB', '\u03BC', '\u00B4', '~', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z', '\u03BD', '\u03BE', '\u03BF', '\u03C0', '\u03C1',
+ '\u03C3', '\u00A3', '\u03AC', '\u03AD', '\u03AE', '\u03CA',
+ '\u03AF', '\u03CC', '\u03CD', '\u03CB', '\u03CE', '\u03C2',
+ '\u03C4', '\u03C5', '\u03C6', '\u03C7', '\u03C8', '{', 'A', 'B',
+ 'C', 'D', 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u03C9', '\u0390',
+ '\u03B0', '\u2018', '\u2015', '}', 'J', 'K', 'L', 'M', 'N', 'O',
+ 'P', 'Q', 'R', '\u00B1', '\u00BD', '\u001A', '\u0387', '\u2019',
+ '\u00A6', '\\', '\u001A', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '\u00B2', '\u00A7', '\u001A', '\u001A', '\u00AB', '\u00AC', '0',
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00A9',
+ '\u001A', '\u001A', '\u00BB', '\u009F', };
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getDescription() {
+ return DESCR;
+ }
+
+ public String getEncoding() {
+ return NAME;
+ }
+
+ @Override
+ protected char[] getCodePage() {
+ return codepage;
+ }
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/encoding/builtin/CodepageConverterAdapter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/encoding/builtin/CodepageConverterAdapter.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,82 @@
+/**
+ * $Id$
+ *
+ * Title: tn5250J
+ * Copyright: Copyright (c) 2001,2009
+ * Company:
+ * @author: master_jaf
+ *
+ * Description:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ */
+package org.tn5250j.encoding.builtin;
+
+import java.util.Arrays;
+
+/**
+ * Adapter class for converters using 8bit codepages.
+ *
+ * @author master_jaf
+ */
+public abstract class CodepageConverterAdapter implements ICodepageConverter {
+
+ private char[] codepage = null;
+ private int[] reverse_codepage = null;
+
+ /* (non-Javadoc)
+ * @see org.tn5250j.cp.ICodepageConverter#init()
+ */
+ public ICodepageConverter init() {
+ codepage = getCodePage();
+
+ int size = 0;
+ for (int i=0; iTitle: ScreenOIAListener
+ *
Description: Main interface to draw the graphical image of the screen
+ *
Copyright: Copyright (c) 2000 - 2002
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * @author Kenneth J. Pouncey
+ * @version 0.5
+ */
+
+package org.tn5250j.event;
+
+import org.tn5250j.framework.tn5250.ScreenOIA;
+
+public interface ScreenOIAListener {
+
+ public static final int OIA_CHANGED_INSERT_MODE = 0;
+ public static final int OIA_CHANGED_KEYS_BUFFERED = 1;
+ public static final int OIA_CHANGED_KEYBOARD_LOCKED = 2;
+ public static final int OIA_CHANGED_MESSAGELIGHT = 3;
+ public static final int OIA_CHANGED_SCRIPT = 4;
+ public static final int OIA_CHANGED_BELL = 5;
+ public static final int OIA_CHANGED_CLEAR_SCREEN = 6;
+ public static final int OIA_CHANGED_INPUTINHIBITED = 7;
+ public static final int OIA_CHANGED_CURSOR = 8;
+
+
+ public void onOIAChanged(ScreenOIA oia, int change);
+
+}
diff -r b3d0d806cbe2 -r 01d939969b10 src/org/tn5250j/framework/tn5250/DataStreamProducer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/tn5250j/framework/tn5250/DataStreamProducer.java Mon Jun 16 08:24:00 2014 -0700
@@ -0,0 +1,358 @@
+package org.tn5250j.framework.tn5250;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.EOFException;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.SocketException;
+import java.util.concurrent.BlockingQueue;
+
+import org.tn5250j.encoding.ICodePage;
+
+import android.util.Log;
+
+import de.mud.terminal.vt320;
+
+
+public class DataStreamProducer implements Runnable {
+ private static final String TAG = "DataStreamProducer";
+ private tnvt vt;
+ private BufferedInputStream bin;
+ private vt320 buffer;
+ private ByteArrayOutputStream baosin;
+ private Thread me;
+ private byte[] saveStream;
+ private final BlockingQueue