COMMON: fix CP950 encoding regression
(I somehow managed to mess up the CP950 encoder with some wrong copy/pasting in b5079ca
)
This commit is contained in:
parent
05b9df0821
commit
cdf19e6376
1 changed files with 7 additions and 9 deletions
|
@ -551,18 +551,16 @@ void String::encodeWindows950(const U32String &src, bool transliterate) {
|
|||
if (!windows950ReverseConversionTable && windows950ConversionTable) {
|
||||
uint16 *rt = new uint16[0x10000]();
|
||||
|
||||
for (uint lowidx = 0; lowidx < 0xb2; lowidx++) {
|
||||
for (uint lowidx = 0; lowidx < 157; lowidx++) {
|
||||
uint8 low = 0;
|
||||
if (lowidx < 0x1a)
|
||||
low = 0x41 + lowidx;
|
||||
else if (lowidx < 0x1a * 2)
|
||||
low = 0x61 + lowidx - 0x1a;
|
||||
if (lowidx < 0x3f)
|
||||
low = 0x40 + lowidx;
|
||||
else
|
||||
low = 0x81 + lowidx - 0x1a * 2;
|
||||
low = 0xa1 + lowidx - 0x3f;
|
||||
|
||||
for (uint highidx = 0; highidx < 0x7e; highidx++) {
|
||||
uint8 high = highidx + 0x81;
|
||||
uint16 unicode = windows949ConversionTable[highidx * 0xb2 + lowidx];
|
||||
for (uint highidx = 0; highidx < 89; highidx++) {
|
||||
uint8 high = highidx + 0xa1;
|
||||
uint16 unicode = windows950ConversionTable[highidx * 157 + lowidx];
|
||||
|
||||
rt[unicode] = (high << 8) | low;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue