Browse Source

Initial implementation of EUC-KR

span
J. King 6 years ago
parent
commit
c4cdbdd5c8
  1. 1
      lib/Encoding/Big5.php
  2. 157
      lib/Encoding/EUCKR.php
  3. 147
      tests/cases/Encoding/TestEUCKR.php
  4. 1
      tests/phpunit.xml
  5. 3
      tools/mktest.php

1
lib/Encoding/Big5.php

@ -144,7 +144,6 @@ class Big5 implements StatelessEncoding {
} else { // the second byte is part of a two-byte sequence, but it's unclear if it's the lead or trail byte
$start = $this->posByte + 2;
$pos = $this->posByte;
$b = $b2;
// go back bytes until a definite trail byte or start of string
while ($pos > 0) {
$b = ord(@$this->string[--$pos]);

157
lib/Encoding/EUCKR.php

File diff suppressed because one or more lines are too long

147
tests/cases/Encoding/TestEUCKR.php

File diff suppressed because one or more lines are too long

1
tests/phpunit.xml

@ -25,6 +25,7 @@
<file>cases/Encoding/TestXUserDefined.php</file>
<file>cases/Encoding/TestGB18030.php</file>
<file>cases/Encoding/TestBig5.php</file>
<file>cases/Encoding/TestEUCKR.php</file>
</testsuite>
</testsuites>
</phpunit>

3
tools/mktest.php

@ -15,6 +15,9 @@ $tests = [
'standard characters' => "https://raw.githubusercontent.com/web-platform-tests/wpt/master/encoding/legacy-mb-tchinese/big5/big5_chars.html",
'extended characters' => "https://raw.githubusercontent.com/web-platform-tests/wpt/master/encoding/legacy-mb-tchinese/big5/big5_chars_extra.html",
],
'euc-kr' => [
'characters' => "https://raw.githubusercontent.com/web-platform-tests/wpt/master/encoding/legacy-mb-korean/euc-kr/euckr_chars.html",
],
'euc-jp' => [
'characters' => "https://raw.githubusercontent.com/web-platform-tests/wpt/master/encoding/legacy-mb-japanese/euc-jp/eucjp_chars.html",
],

Loading…
Cancel
Save