Skip to content

Mismatch of unicode to Big5 #264

@aowakennomai

Description

@aowakennomai

Hi,
I just found (at least) one word in Chinese is not correctly encoded from unicode to Big5.
I'm not sure is there any other word has the same problem.
However, it is correct in https://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT

0xB05F	0x8D77	# <CJK>

To reproduce the problem:

const char = '起';
const code = char.charCodeAt(0);
console.log(code.toString(16)); // 8d77

const buff = iconv.encode(char, 'big5');
console.log(buff.toString('hex')); // 8ffe ...which is not correct. It should be b05f

my environment is:
nodejs: v12.22.1
npm: v7.9.0
icon-lite@0.6.2

├─┬ body-parser@1.19.0
│ ├── iconv-lite@0.4.24
│ └─┬ raw-body@2.4.0
│   └── iconv-lite@0.4.24
├─┬ eslint@6.8.0
│ └─┬ inquirer@7.3.3
│   └─┬ external-editor@3.1.0
│     └── iconv-lite@0.4.24
├── iconv-lite@0.6.2
├─┬ mssql@5.1.4
│ └─┬ tedious@4.2.0
│   └── iconv-lite@0.4.24
├─┬ mysql2@1.6.5
│ └── iconv-lite@0.4.24
├─┬ node-fetch@1.7.3
│ └─┬ encoding@0.1.13
│   └── iconv-lite@0.6.2 deduped
└─┬ pdfmake@0.1.71
  └── iconv-lite@0.6.2 deduped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions