/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 4454622
@summary Check if all supported sun.io encoding names are supported in nio.charset
*/
public class SunioAlias {
String s = "testing string";
boolean failed = false;
/* See if StringCoding works correctly without sun.io package */
try {
}
} catch (UnsupportedEncodingException e) {
failed = true;
} catch (IllegalCharsetNameException e) {
failed = true;
}
}
if (failed)
throw new UnsupportedEncodingException ("sun.io encoding names are not supported in nio.charset!");
}
//aliasTable is copy/pasted from sun.io.CharacterEncoding.java
static {
/* known failed names... TBD
// JIS-defined Shift JIS
aliasTable.put("\u30b7\u30d5\u30c8\u7b26\u53f7\u5316\u8868\u73fe",
"SJIS");
// Specialized auto-detection for Japanese charsets
aliasTable.put("jis auto detect", "JISAutoDetect");
// MIBenum: 1010
aliasTable.put("unicode-1-1", "UnicodeBigUnmarked");
*/
/*
// X11 Compound Text
aliasTable.put("x-compound-text", "COMPOUND_TEXT");
aliasTable.put("x11-compound_text", "COMPOUND_TEXT");
*/
// Core encodings
// Standard encodings used on Solaris and Linux
// Windows encodings
// MIBenum: 4
// MIBenum: 5
// MIBenum: 6
// MIBenum: 7
// MIBenum: 8
// MIBenum: 9
// MIBenum: 10
// MIBenum: 11
// MIBenum: 12
// MIBenum: ???
// MIBenum: ????
//For compatibility purpose
// MIBenum: 106
// Alias recommended in RFC 1641
// MIBenum: 1000
// Per Unicode standard
// Used by drag-and-drop subsystem
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: 2011
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// "Cp850"
// MIBenum: 2009
// "Cp852"
// MIBenum: 2010
// "Cp855"
// MIBenum: 2046
// "Cp855"
// MIBenum: ???
// "Cp857"
// MIBenum: 2047
// "Cp860"
// MIBenum: 2048
// MIBenum: 2049
// MIBenum: 2013
// MIBenum: 2050
// MIBenum: 2051
// MIBenum: 2052
// MIBenum: ????
// MIBenum: ????
// MIBenum: 2054
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: ????
// MIBenum: 16/39
// MIBenum: 17/2024
/*if (sjisIsMS932) {
aliasTable.put("shift_jis", "MS932"); // IANA shift jis aliases
aliasTable.put("csshiftjis", "MS932"); // updated per 4556882
aliasTable.put("x-sjis", "MS932");
aliasTable.put("ms_kanji", "MS932");
} else {
*/
/*
}
*/
// MIBenum: 18
// Japanese EUC
"EUC_JP");
// For handing only JIS0202 and JIS0208 in linux
// MIBenum: 874
// MIBenum: 2250
// MIBenum: 2251
// MIBenum: 2252
// MIBenum: 2253
// MIBenum: 2254
// MIBenum: 2255
// MIBenum: 2256
// MIBenum: 2257
// MIBenum: 2258
// MIBenum: ????
// Russian KOI8-R
// Simplified Chinese
// Added for future compatibility, explicit mapping to Unicode 3.0
// Traditional Chinese
// Korean
//MIBenum: 37
// Thai
// Variants
}
}