@@ 946-948 (lines=3) @@ | ||
943 | $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
944 | } elseif ($v < (1 << 16)) { // 3 bytes |
|
945 | $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
946 | } elseif ($v < (1 << 21)) { // 4 bytes |
|
947 | $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
948 | } else { |
|
949 | $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
950 | return false; |
|
951 | } |
@@ 154-156 (lines=3) @@ | ||
151 | $output .= chr(192+($v >> 6)).chr(128+($v & 63)); |
|
152 | } elseif ($v < (1 << 16)) { // 3 bytes |
|
153 | $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); |
|
154 | } elseif ($v < (1 << 21)) { // 4 bytes |
|
155 | $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); |
|
156 | } elseif (self::$safe_mode) { |
|
157 | $output .= self::$safe_char; |
|
158 | } else { |
|
159 | throw new Exception('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |