| 1 | Index: src/header.c |
| 2 | =================================================================== |
| 3 | --- src/header.c (revision 871) |
| 4 | +++ src/header.c (working copy) |
| 5 | @@ -1798,6 +1798,7 @@ |
| 6 | unsigned long usedByteLen = 0; |
| 7 | UniChar uniStr[256]; |
| 8 | unsigned long cfResult; |
| 9 | + unsigned int i; |
| 10 | |
| 11 | cfResult = CFStringEncodingBytesToUnicode(kCFStringEncodingUTF8, |
| 12 | flags, |
| 13 | @@ -1808,6 +1809,38 @@ |
| 14 | 255, |
| 15 | &unicodeChars); |
| 16 | if (cfResult == 0) { |
| 17 | + /* vender-specific character conversion |
| 18 | + http://www.ingrid.org/java/i18n/unicode.html */ |
| 19 | + for (i=0; i<255; i+=2) { |
| 20 | + if (uniStr[i] == 0x20 && uniStr[i+1] == 0x3e) { |
| 21 | + /* OVERLINE -> FULLWIDTH MACRON */ |
| 22 | + uniStr[i] = 0xff; uniStr[i+1] = 0xe3; |
| 23 | + } else if (uniStr[i] == 0x20 && uniStr[i+1] == 0x14) { |
| 24 | + /* EM DASH -> HORIZONTAL BAR */ |
| 25 | + uniStr[i] = 0x20; uniStr[i+1] = 0x15; |
| 26 | + } else if (uniStr[i] == 0x30 && uniStr[i+1] == 0x1c) { |
| 27 | + /* WAVE DASH -> FULLWIDTH TILDE */ |
| 28 | + uniStr[i] = 0xff; uniStr[i+1] = 0x5e; |
| 29 | + } else if (uniStr[i] == 0x20 && uniStr[i+1] == 0x16) { |
| 30 | + /* DOUBLE VERTICAL LINE -> PARALLEL TO */ |
| 31 | + uniStr[i] = 0x22; uniStr[i+1] = 0x25; |
| 32 | + } else if (uniStr[i] == 0x22 && uniStr[i+1] == 0xef) { |
| 33 | + /* MIDLINE HORIZONTAL ELLIPSIS -> HORIZONTAL ELLIPSIS */ |
| 34 | + uniStr[i] = 0x20; uniStr[i+1] = 0x26; |
| 35 | + } else if (uniStr[i] == 0x22 && uniStr[i+1] == 0x12) { |
| 36 | + /* MINUS SIGN -> FULLWIDTH HYPHEN-MINUS */ |
| 37 | + uniStr[i] = 0xff; uniStr[i+1] = 0x0d; |
| 38 | + } else if (uniStr[i] == 0x00 && uniStr[i+1] == 0xa2) { |
| 39 | + /* CENT SIGN -> FULLWIDTH CENT SIGN */ |
| 40 | + uniStr[i] = 0xff; uniStr[i+1] = 0xe0; |
| 41 | + } else if (uniStr[i] == 0x00 && uniStr[i+1] == 0xa3) { |
| 42 | + /* POUND SIGN -> FULLWIDTH POUND SIGN */ |
| 43 | + uniStr[i] = 0xff; uniStr[i+1] = 0xe1; |
| 44 | + } else if (uniStr[i] == 0x00 && uniStr[i+1] == 0xac) { |
| 45 | + /* NOT SIGN -> FULLWIDTH NOT SIGN */ |
| 46 | + uniStr[i] = 0xff; uniStr[i+1] = 0xe2; |
| 47 | + } |
| 48 | + } |
| 49 | cfResult = CFStringEncodingUnicodeToBytes(scriptEncoding, |
| 50 | flags, |
| 51 | uniStr, |