Skip to content

Commit ec2d8d0

Browse files
authored
Merge pull request #319 from formalism/add_sjis_chars
Add some missing SJIS characters
2 parents 5876949 + 9500309 commit ec2d8d0

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

helper/to-sjis.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
const SJIS_UTF8 = [
22
[0x8140, ' 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈〉《》「」『』【】+-±×'],
3-
[0x8180, '÷=≠<>'],
4-
[0x818f, '¥$¢£%#&*@§☆★'],
3+
[0x8180, '÷=≠<>≦≧∞∴♂♀°′″℃'],
4+
[0x818f, '¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼'],
55
[0x81a6, '※〒→←↑↓〓'],
6-
[0x81ca, '¬'],
6+
[0x81b8, '∈∋⊆⊇⊂⊃∪∩'],
7+
[0x81c8, '∧∨¬⇒⇔∀∃'],
8+
[0x81da, '∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬'],
9+
[0x81f0, 'ʼn♯♭♪†‡¶'],
710
[0x824f, '0123456789'],
811
[0x8260, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'],
912
[0x8281, 'abcdefghijklmnopqrstuvwxyz'],
@@ -16,6 +19,8 @@ const SJIS_UTF8 = [
1619
[0x8470, 'абвгдеёжзийклмн'],
1720
[0x8480, 'опрстуфхцчшщъыьэюя'],
1821
[0x8780, '〝〟'],
22+
[0x889f, '亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣'],
23+
[0x88e0, '謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭'],
1924
[0x8940, '院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円'],
2025
[0x8980, '園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改'],
2126
[0x8a40, '魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫'],

test/unit/helper/sjis.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,20 @@ test('SJIS from char', function (t) {
1414
t.equal(toSJIS('¬'), 0x81ca,
1515
'Should return correct SJIS value')
1616

17+
t.equal(toSJIS('≧'), 0x8186,
18+
'Should return correct SJIS value')
19+
20+
t.equal(toSJIS('⊥'), 0x81db,
21+
'Should return correct SJIS value')
22+
23+
t.equal(toSJIS('愛'), 0x88a4,
24+
'Should return correct SJIS value')
25+
26+
t.equal(toSJIS('衣'), 0x88df,
27+
'Should return correct SJIS value')
28+
29+
t.equal(toSJIS('蔭'), 0x88fc,
30+
'Should return correct SJIS value')
31+
1732
t.end()
1833
})

0 commit comments

Comments
 (0)