View Javadoc

1   /*
2    * EDI-Knight Integration and Transformation Platform
3    * Copyright (C) 2006-2007 Holger Joest <hjoest@users.sourceforge.net>
4    *
5    * This program is free software; you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation; either version 2 of the License, or
8    * (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  
20  package net.sf.ediknight.charset;
21  
22  import java.nio.charset.Charset;
23  import java.nio.charset.CharsetDecoder;
24  import java.nio.charset.CharsetEncoder;
25  
26  
27  /***
28   * @author Holger Joest
29   */
30  public final class ISO_646_CA2
31  extends Charset {
32  
33      private static final String CANONICAL_NAME =
34          "CSA_Z243.4-1985-2";
35  
36      private static final String[] ALIASES = {
37          // IANA
38          "iso-ir-122",
39          "ISO646-CA2",
40          "csa7-2",
41          "csISO122Canadian2",
42          // other
43          "ISO_646-CA2",
44          "ISO-646-CA2"
45      };
46  
47      private static final String CHARS =
48          "\u0023\u0024\u00E0\u00E2\u00E7\u00EA"
49          + "\u00C9\u00F4\u00E9\u00F9\u00E8\u00FB";
50  
51  
52      /***
53       * Constructor.
54       */
55      public ISO_646_CA2() {
56          super(CANONICAL_NAME, ALIASES);
57      }
58  
59  
60      /***
61       * {@inheritDoc}
62       * @see java.nio.charset.Charset#contains(
63       *      java.nio.charset.Charset)
64       */
65      @Override
66      public boolean contains(Charset cs) {
67          return false;
68      }
69  
70  
71      /***
72       * {@inheritDoc}
73       * @see java.nio.charset.Charset#newDecoder()
74       */
75      @Override
76      public CharsetDecoder newDecoder() {
77          return new LegacyCharsetDecoder(this, CHARS);
78      }
79  
80  
81      /***
82       * {@inheritDoc}
83       * @see java.nio.charset.Charset#newEncoder()
84       */
85      @Override
86      public CharsetEncoder newEncoder() {
87          return new LegacyCharsetEncoder(this, CHARS);
88      }
89  
90  }
91