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_GB
31  extends Charset {
32  
33      private static final String CANONICAL_NAME = "BS_4730";
34  
35      private static final String[] ALIASES = {
36          // IANA
37          "iso-ir-4",
38          "ISO646-GB",
39          "gb",
40          "uk",
41          "csISO4UnitedKingdom",
42          // other
43          "ISO_646-UK",
44          "ISO_646-GB",
45          "ISO-646-UK",
46          "ISO-646-GB"
47      };
48  
49      private static final String CHARS =
50          "\u00A3\u0024\u0040\u005B//\u005D"
51          + "\u005E\u0060\u007B\u007C\u007D\u203E";
52  
53  
54      /***
55       * Constructor.
56       */
57      public ISO_646_GB() {
58          super(CANONICAL_NAME, ALIASES);
59      }
60  
61  
62      /***
63       * {@inheritDoc}
64       * @see java.nio.charset.Charset#contains(java.nio.charset.Charset)
65       */
66      @Override
67      public boolean contains(Charset cs) {
68          return false;
69      }
70  
71  
72      /***
73       * {@inheritDoc}
74       * @see java.nio.charset.Charset#newDecoder()
75       */
76      @Override
77      public CharsetDecoder newDecoder() {
78          return new LegacyCharsetDecoder(this, CHARS);
79      }
80  
81  
82      /***
83       * {@inheritDoc}
84       * @see java.nio.charset.Charset#newEncoder()
85       */
86      @Override
87      public CharsetEncoder newEncoder() {
88          return new LegacyCharsetEncoder(this, CHARS);
89      }
90  
91  }
92