1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #2865 from vyv03354/90pv

Implement "90pv" CMap
This commit is contained in:
Yury Delendik 2013-03-02 09:31:07 -08:00
commit de9f0a9435
3 changed files with 23 additions and 0 deletions

View file

@ -412,6 +412,7 @@ var CMapConverterList = {
'EUC-H': eucjpToUnicode,
'EUC-V': eucjpToUnicode,
'83pv-RKSJ-H': sjis83pvToUnicode,
'90pv-RKSJ-H': sjis90pvToUnicode,
'90ms-RKSJ-H': sjisToUnicode,
'90ms-RKSJ-V': sjisToUnicode,
'90msp-RKSJ-H': sjisToUnicode,
@ -479,6 +480,18 @@ function sjis83pvToUnicode(str) {
}
}
function sjis90pvToUnicode(str) {
var bytes = stringToBytes(str);
try {
// TODO: 90pv has incompatible mappings in 8740..879c and eb41..ee9c.
return decodeBytes(bytes, 'shift_jis', true);
} catch (e) {
TODO('Unsupported 90pv character found');
// Just retry without checking errors for now.
return decodeBytes(bytes, 'shift_jis');
}
}
function gbkToUnicode(str) {
return decodeBytes(stringToBytes(str), 'gbk');
}