annotate src/org/tn5250j/encoding/builtin/CCSID37.java @ 353:20412de44c06

update jsocks to 2011-03-19
author Carl Byington <carl@five-ten-sg.com>
date Fri, 01 Aug 2014 11:35:35 -0700
parents 77ac18bc1b2f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
1 /**
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
2 * $Id$
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
3 *
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
4 * Title: tn5250J
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
5 * Copyright: Copyright (c) 2001,2009
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
6 * Company:
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
7 * @author: master_jaf
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
8 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
9 * Description:
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
10 * Alternative (extended) implementation of a codepage converter CCSID 37<->Unicode.
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
11 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
12 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
13 * This program is free software; you can redistribute it and/or modify
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
14 * it under the terms of the GNU General Public License as published by
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
15 * the Free Software Foundation; either version 2, or (at your option)
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
16 * any later version.
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
17 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
18 * This program is distributed in the hope that it will be useful,
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
21 * GNU General Public License for more details.
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
22 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
23 * You should have received a copy of the GNU General Public License
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
24 * along with this software; see the file COPYING. If not, write to
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
25 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
26 * Boston, MA 02111-1307 USA
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
27 *
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
28 */
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
29 package org.tn5250j.encoding.builtin;
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
30
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
31
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
32 /**
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
33 * @author master_jaf
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
34 * @see http://www-01.ibm.com/software/globalization/ccsid/ccsid37.jsp
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
35 */
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
36 public final class CCSID37 extends CodepageConverterAdapter {
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
37
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
38 public final static String NAME = "37";
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
39 public final static String DESCR = "CECP: USA, Canada (ESA*), Netherlands, Portugal, Brazil, Australia, New Zealand";
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
40
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
41 /*
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
42 * Char maps manually extracted from JTOpen v6.4. Because char maps can't be
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
43 * covered by any license, this should legal.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
44 */
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
45 private static final char[] codepage = { '\u0000', '\u0001', '\u0002',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
46 '\u0003', '\u009C', '\t', '\u0086', '\u007F', '\u0097', '\u008D',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
47 '\u008E', '\u000B', '\f', '\r', '\u000E', '\u000F', '\u0010',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
48 '\u0011', '\u0012', '\u0013', '\u009D', '\u0085', '\u0008',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
49 '\u0087', '\u0018', '\u0019', '\u0092', '\u008F', '\u001C',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
50 '\u001D', '\u001E', '\u001F', '\u0080', '\u0081', '\u0082',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
51 '\u0083', '\u0084', '\n', '\u0017', '\u001B', '\u0088', '\u0089',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
52 '\u008A', '\u008B', '\u008C', '\u0005', '\u0006', '\u0007',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
53 '\u0090', '\u0091', '\u0016', '\u0093', '\u0094', '\u0095',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
54 '\u0096', '\u0004', '\u0098', '\u0099', '\u009A', '\u009B',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
55 '\u0014', '\u0015', '\u009E', '\u001A', ' ', '\u00A0', '\u00E2',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
56 '\u00E4', '\u00E0', '\u00E1', '\u00E3', '\u00E5', '\u00E7',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
57 '\u00F1', '\u00A2', '.', '<', '(', '+', '|', '&', '\u00E9',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
58 '\u00EA', '\u00EB', '\u00E8', '\u00ED', '\u00EE', '\u00EF',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
59 '\u00EC', '\u00DF', '!', '$', '*', ')', ';', '\u00AC', '-', '/',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
60 '\u00C2', '\u00C4', '\u00C0', '\u00C1', '\u00C3', '\u00C5',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
61 '\u00C7', '\u00D1', '\u00A6', ',', '%', '_', '>', '?', '\u00F8',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
62 '\u00C9', '\u00CA', '\u00CB', '\u00C8', '\u00CD', '\u00CE',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
63 '\u00CF', '\u00CC', '`', ':', '#', '@', '\'', '=', '"', '\u00D8',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
64 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\u00AB', '\u00BB',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
65 '\u00F0', '\u00FD', '\u00FE', '\u00B1', '\u00B0', 'j', 'k', 'l',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
66 'm', 'n', 'o', 'p', 'q', 'r', '\u00AA', '\u00BA', '\u00E6',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
67 '\u00B8', '\u00C6', '\u00A4', '\u00B5', '~', 's', 't', 'u', 'v',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
68 'w', 'x', 'y', 'z', '\u00A1', '\u00BF', '\u00D0', '\u00DD',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
69 '\u00DE', '\u00AE', '^', '\u00A3', '\u00A5', '\u00B7', '\u00A9',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
70 '\u00A7', '\u00B6', '\u00BC', '\u00BD', '\u00BE', '[', ']',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
71 '\u00AF', '\u00A8', '\u00B4', '\u00D7', '{', 'A', 'B', 'C', 'D',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
72 'E', 'F', 'G', 'H', 'I', '\u00AD', '\u00F4', '\u00F6', '\u00F2',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
73 '\u00F3', '\u00F5', '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
74 'R', '\u00B9', '\u00FB', '\u00FC', '\u00F9', '\u00FA', '\u00FF',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
75 '\\', '\u00F7', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u00B2',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
76 '\u00D4', '\u00D6', '\u00D2', '\u00D3', '\u00D5', '0', '1', '2',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
77 '3', '4', '5', '6', '7', '8', '9', '\u00B3', '\u00DB', '\u00DC',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
78 '\u00D9', '\u00DA', '\u009F',
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
79 };
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
80
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
81
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
82 public String getName() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
83 return NAME;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
84 }
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
85
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
86 public String getDescription() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
87 return DESCR;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
88 }
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
89
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
90 public String getEncoding() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
91 return NAME;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
92 }
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
93
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
94 @Override
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
95 protected char[] getCodePage() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
96 return codepage;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 27
diff changeset
97 }
27
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
98
b29b39f386a4 adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents: 5
diff changeset
99 }