|
20 | 20 | package org.jcodings.transcode;
|
21 | 21 |
|
22 | 22 | import org.jcodings.transcode.Transcoder.GenericTranscoderEntry;
|
| 23 | +import org.jcodings.transcode.specific.*; |
23 | 24 |
|
24 | 25 | final class TranscoderList {
|
25 | 26 | static void load() {
|
@@ -388,4 +389,39 @@ static void load() {
|
388 | 389 | new GenericTranscoderEntry("UTF-8", "CP855", 30732, "SingleByte", 1, 4, 1, AsciiCompatibility.CONVERTER, 0),
|
389 | 390 | new GenericTranscoderEntry("UTF-8", "UTF8-MAC", 52420, "Utf8Mac", 1, 4, 9, AsciiCompatibility.CONVERTER, 0)
|
390 | 391 | };
|
| 392 | + |
| 393 | + public static Transcoder getInstance(String name) { |
| 394 | + switch (name) { |
| 395 | + case "Iso2022jp_kddi_decoder": return Iso2022jp_kddi_decoder_Transcoder.INSTANCE; |
| 396 | + case "Iso2022jp_kddi_encoder": return Iso2022jp_kddi_encoder_Transcoder.INSTANCE; |
| 397 | + case "Escape_xml_attr_quote": return Escape_xml_attr_quote_Transcoder.INSTANCE; |
| 398 | + case "From_GB18030": return From_GB18030_Transcoder.INSTANCE; |
| 399 | + case "To_GB18030": return To_GB18030_Transcoder.INSTANCE; |
| 400 | + case "Iso2022jp_decoder": return Iso2022jp_decoder_Transcoder.INSTANCE; |
| 401 | + case "Iso2022jp_encoder": return Iso2022jp_encoder_Transcoder.INSTANCE; |
| 402 | + case "Stateless_iso2022jp_to_eucjp": return Stateless_iso2022jp_to_eucjp_Transcoder.INSTANCE; |
| 403 | + case "Eucjp_to_stateless_iso2022jp": return Eucjp_to_stateless_iso2022jp_Transcoder.INSTANCE; |
| 404 | + case "Cp50220_decoder": return Cp50220_decoder_Transcoder.INSTANCE; |
| 405 | + case "Cp50221_decoder": return Cp50221_decoder_Transcoder.INSTANCE; |
| 406 | + case "Cp50221_encoder": return Cp50221_encoder_Transcoder.INSTANCE; |
| 407 | + case "Cp50220_encoder": return Cp50220_encoder_Transcoder.INSTANCE; |
| 408 | + case "Eucjp2sjis": return Eucjp2sjis_Transcoder.INSTANCE; |
| 409 | + case "Sjis2eucjp": return Sjis2eucjp_Transcoder.INSTANCE; |
| 410 | + case "Universal_newline": return Universal_newline_Transcoder.INSTANCE; |
| 411 | + case "From_UTF8_MAC": return From_UTF8_MAC_Transcoder.INSTANCE; |
| 412 | + case "From_UTF_16BE": return From_UTF_16BE_Transcoder.INSTANCE; |
| 413 | + case "To_UTF_16BE": return To_UTF_16BE_Transcoder.INSTANCE; |
| 414 | + case "From_UTF_16LE": return From_UTF_16LE_Transcoder.INSTANCE; |
| 415 | + case "To_UTF_16LE": return To_UTF_16LE_Transcoder.INSTANCE; |
| 416 | + case "From_UTF_32BE": return From_UTF_32BE_Transcoder.INSTANCE; |
| 417 | + case "To_UTF_32BE": return To_UTF_32BE_Transcoder.INSTANCE; |
| 418 | + case "From_UTF_32LE": return From_UTF_32LE_Transcoder.INSTANCE; |
| 419 | + case "To_UTF_32LE": return To_UTF_32LE_Transcoder.INSTANCE; |
| 420 | + case "From_UTF_16": return From_UTF_16_Transcoder.INSTANCE; |
| 421 | + case "From_UTF_32": return From_UTF_32_Transcoder.INSTANCE; |
| 422 | + case "To_UTF_16": return To_UTF_16_Transcoder.INSTANCE; |
| 423 | + case "To_UTF_32": return To_UTF_32_Transcoder.INSTANCE; |
| 424 | + default: return Transcoder.load(name); |
| 425 | + } |
| 426 | + } |
391 | 427 | }
|
0 commit comments