ICU-5444 Add code to handle the different versions of ISCII charset.

X-SVN-Rev: 21626
This commit is contained in:
Michael Ow 2007-06-04 21:39:42 +00:00
parent 2a0a22f0ad
commit fa144dc2d9
2 changed files with 13 additions and 16 deletions

View File

@ -131,16 +131,16 @@ public abstract class CharsetICU extends Charset{
algorithmicCharsets.put("UTF-8", "com.ibm.icu.charset.CharsetUTF8" );
algorithmicCharsets.put("CESU-8", "com.ibm.icu.charset.CharsetCESU8" );
algorithmicCharsets.put("UTF-7", "com.ibm.icu.charset.CharsetUTF7" );
/*algorithmicCharsets.put("ISCII,version=0", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=0", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=1", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=2", "com.ibm.icu.charset.CharsetISCII" );
/*algorithmicCharsets.put("ISCII,version=2", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=3", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=4", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=5", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=6", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=7", "com.ibm.icu.charset.CharsetISCII" );
algorithmicCharsets.put("ISCII,version=8", "com.ibm.icu.charset.CharsetISCII" );*/
}
algorithmicCharsets.put("ISCII,version=8", "com.ibm.icu.charset.CharsetISCII" );
*/}
/*public*/ static final Charset getCharset(String icuCanonicalName, String javaCanonicalName, String[] aliases){
String className = (String) algorithmicCharsets.get(icuCanonicalName);

View File

@ -721,24 +721,21 @@ class CharsetISCII extends CharsetICU {
maxBytesPerChar = 4;
minBytesPerChar = 1;
maxCharsPerByte = 1;
int test = lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].uniLang;
int test2 = UniLang.DELTA;
char temp = (char)(test * test2);
int test3 = temp + 3;
//get the version number of the ISCII converter
int option = Integer.parseInt(icuCanonicalName.substring(14));
extraInfo = new UConverterDataISCII(
NO_CHAR_MARKER, /* contextCharToUnicode */
0x0000, /* contextCharFromUnicode */
(short)(lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* defDeltaToUnicode */
(short)(lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* currentDeltaFromUnicode */
(short)(lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* currentDeltaToUnicode */
(short)lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* currentMaskToUnicode */
(short)lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* currentMaskFromUnicode */
(short)lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* defMaskToUnicode */
(short)(lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* defDeltaToUnicode */
(short)(lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* currentDeltaFromUnicode */
(short)(lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].uniLang * UniLang.DELTA), /* currentDeltaToUnicode */
(short)lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* currentMaskToUnicode */
(short)lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* currentMaskFromUnicode */
(short)lookupInitialData[option & UCNV_OPTIONS_VERSION_MASK].maskEnum, /* defMaskToUnicode */
true, /* isFirstBuffer */
false, /* resetToDefaultToUnicode */
ISCII_CNV_PREFIX /* name */
new String(ISCII_CNV_PREFIX + (option & UCNV_OPTIONS_VERSION_MASK)) /* name */
);
}