/* Write the language code following LF only if LF is not the last character. */
if (fromUnicodeStatus == LF) {
targetByteUnit = ATR << 8;
- targetByteUnit += (byte)lookupInitialData[range].isciiLang;
+ targetByteUnit += 0xff & (byte)lookupInitialData[range].isciiLang;
fromUnicodeStatus = 0x0000;
/* now append ATR and language code */
cr = WriteToTargetFromU(offsets, source, target, targetByteUnit);
int st1, st2, st3, i;
for (st1 = 0; stageUTF8Index < stageUTF8Length; ++st1) {
- st2 = ((char)stage[2*st1]<<8) | stage[2*st1+1];
+ st2 = ((char)stage[2*st1]<<8) | (0xff & stage[2*st1+1]);
if (st2 != stage1Length/2) {
/* each stage 2 block has 64 entries corresponding to 16 entries in the mbcsIndex */
for (i = 0; i < 16; ++i) {
/**
*******************************************************************************
-* Copyright (C) 1996-2010, International Business Machines Corporation and *
+* Copyright (C) 1996-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
StringBuilder key = new StringBuilder(size);
int i = 0;
while (m_key_[i] != 0 && m_key_[i + 1] != 0) {
- key.append((char)((m_key_[i] << 8) | m_key_[i + 1]));
+ key.append((char)((m_key_[i] << 8) | (0xff & m_key_[i + 1])));
i += 2;
}
if (m_key_[i] != 0) {