Skip to content

Commit 4f22327

Browse files
Merge pull request #51 from polygonplanet/feature/fix-readme-encoding
docs(readme): fix wrong character codes
2 parents 1cb5821 + 7a8328e commit 4f22327

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Since JavaScript string values are internally encoded as UTF-16 code units
5555
they cannot directly handle other character encodings as strings. However, encoding.js overcomes this limitation by treating these encodings as arrays instead of strings,
5656
enabling the conversion between different character sets.
5757

58-
Each character encoding is represented as an array of numbers corresponding to character code values, for example, `[130, 160]` represents "あ" in UTF-8.
58+
Each character encoding is represented as an array of numbers corresponding to character code values, for example, `[130, 160]` represents "あ" in Shift_JIS.
5959

6060
The array of character codes used in its methods can also be utilized with TypedArray objects, such as `Uint8Array`, or with `Buffer` in Node.js.
6161

README_ja.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ encoding.js は、文字コードの変換や判定をする JavaScript ライ
5151
`Shift_JIS``EUC-JP``ISO-2022-JP` など日本語の文字コードや、 `UTF-8``UTF-16` などの Unicode に対応しています。
5252

5353
JavaScript の文字列は内部で UTF-16 コードユニットとして符号化されるため、文字列のままでは他の文字コードを正しく扱えませんが ([参照: ECMAScript® 2019 Language Specification - 6.1.4 The String Type](https://www.ecma-international.org/ecma-262/10.0/index.html#sec-ecmascript-language-types-string-type))、encoding.js では文字列ではなく配列として扱い変換を実現しています。
54-
各文字コードは、例えば `[130, 160]` (UTF-8の「あ」) などの文字コード値を持つ数値の配列として扱います。
54+
各文字コードは、例えば `[130, 160]` (Shift_JIS の「あ」) などの文字コード値を持つ数値の配列として扱います。
5555

5656
また、encoding.js の各メソッドに渡す文字コードの配列は、`Uint8Array` などの TypedArray や Node.js の `Buffer` でも使えます。
5757

0 commit comments

Comments
 (0)