Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Add Thai Alphabets and Vowel in Encode and Decode for Punycode #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
23 changes: 22 additions & 1 deletion src/Punycode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ class Punycode
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'ก', 'ข', 'ฃ', 'ค', 'ฅ', 'ฆ', 'ง', 'จ', 'ฉ', 'ช', 'ซ', 'ฌ',
'ญ', 'ฎ', 'ฏ', 'ฐ', 'ฑ', 'ฒ', 'ณ', 'ด', 'ต', 'ถ', 'ท', 'ธ',
'ณ', 'ด', 'ต', 'ถ', 'ท', 'ธ', 'น', 'บ', 'ป', 'ผ', 'ฝ', 'พ',
'ฟ', 'ม', 'ย', 'ร', 'ล', 'ว', 'ศ', 'ษ', 'ส', 'ห', 'ฬ', 'อ',
'ฮ', 'ะ', 'ิ', 'ี', 'ึ', '์', 'ุ', 'ู', 'เ', 'แ', 'โ', 'ำ',
'ใ', 'ไ', 'ฤ','ฤา', 'ฦ', 'ฦา', 'โ', '่', '้', '๊', '๋', '็',
'์'

);

/**
Expand All @@ -48,7 +56,20 @@ class Punycode
'm' => 12, 'n' => 13, 'o' => 14, 'p' => 15, 'q' => 16, 'r' => 17,
's' => 18, 't' => 19, 'u' => 20, 'v' => 21, 'w' => 22, 'x' => 23,
'y' => 24, 'z' => 25, '0' => 26, '1' => 27, '2' => 28, '3' => 29,
'4' => 30, '5' => 31, '6' => 32, '7' => 33, '8' => 34, '9' => 35
'4' => 30, '5' => 31, '6' => 32, '7' => 33, '8' => 34, '9' => 35,
'ก' => 36, 'ข' => 37, 'ฃ' => 38, 'ค' => 39, 'ฅ' => 40, 'ฆ' => 41,
'ง' => 42, 'จ' => 43, 'ฉ' => 44, 'ช' => 45, 'ซ' => 46, 'ฌ' => 47,
'ญ' => 48, 'ฎ' => 49, 'ฏ' => 50, 'ฐ' => 51, 'ฑ' => 52, 'ฒ' => 53,
'ณ' => 54, 'ด' => 55, 'ต' => 56, 'ถ' => 57, 'ท' => 58, 'ธ' => 59,
'ณ' => 60, 'ด' => 61, 'ต' => 62, 'ถ' => 63, 'ท' => 64, 'ธ' => 65,
'น' => 66, 'บ' => 67, 'ป' => 68, 'ผ' => 69, 'ฝ' => 70, 'พ' => 71,
'ฟ' => 72, 'ม' => 73, 'ย' => 74, 'ร' => 75, 'ล' => 76, 'ว' => 77,
'ศ' => 78, 'ษ' => 79, 'ส' => 80, 'ห' => 81, 'ฬ' => 82, 'อ' => 83,
'ฮ' => 84, 'ะ' => 85, 'ิ' => 86, 'ี' => 87, 'ึ' => 88, '์' => 89,
'ุ' => 90, 'ู' => 91, 'เ' => 92, 'แ' => 93, 'โ' => 94, 'ำ' => 95,
'ใ' => 96, 'ไ' => 97, 'ฤ' => 98,'ฤา' => 99, 'ฦ' => 100,'ฦา' => 101,
'โ' => 102,'่' => 103,'้' => 104, '๊' => 105, '๋' => 106, '็' => 107,
'์' => 108
);

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/PunycodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ public function domainNamesProvider()
'άέήίΰαβγδεζηθικλμνξοπρσστυφχ.com',
'xn--hxacdefghijklmnopqrstuvw0caz0a1a2a.com'
),
array(
'อีเมลทดสอบ@ยูเอทดสอบ.ไทย',
'[email protected]'
),
array(
'อีเมลทดสอบ@ทีเอชนิค.องค์กร.ไทยย',
'[email protected]'
),
);
}

Expand Down