Permalink
Browse files

fixed get_key()

  • Loading branch information...
wkpark committed May 8, 2017
1 parent f1359df commit 692985f217bd49164de76b7b14b5d99b00e86290
Showing with 2 additions and 4 deletions.
  1. +2 −4 wikilib.php
View
@@ -4994,11 +4994,9 @@ function get_key($name) {
if ($utf or $use_utf) {
if ((ord($name[0]) & 0xF0) == 0xE0) { # Now only 3-byte UTF-8 supported
#$uni1=((ord($name[0]) & 0x0f) <<4) | ((ord($name[1]) & 0x7f) >>2);
$uni1=((ord($name[0]) & 0x0f) <<4) | (($name[1] & 0x7f) >>2);
$uni2=((ord($name[1]) & 0x7f) <<6) | (ord($name[2]) & 0x7f);
$uni=((ord($name[0]) & 0x0f) << 12) |
((ord($name[1]) & 0x7f) << 6) | (ord($name[2]) & 0x7f);
$uni=($uni1<<8)+$uni2;
# Hangul Syllables
if ($uni>=0xac00 && $uni<=0xd7a3) {
$ukey=0xac00 + (int)(($uni - 0xac00) / 588) * 588;

0 comments on commit 692985f

Please sign in to comment.