|
@@ 2690-2693 (lines=4) @@
|
| 2687 |
|
if ($c <= 0x7F) { |
| 2688 |
|
$unicode[] = $c; // use the character "as is" because is ASCII |
| 2689 |
|
$numbytes = 1; |
| 2690 |
|
} elseif (($c >> 0x05) === 0x06) { // 2 bytes character (0x06 = 110 BIN) |
| 2691 |
|
$bytes[] = ($c - 0xC0) << 0x06; |
| 2692 |
|
$numbytes = 2; |
| 2693 |
|
} elseif (($c >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN) |
| 2694 |
|
$bytes[] = ($c - 0xE0) << 0x0C; |
| 2695 |
|
$numbytes = 3; |
| 2696 |
|
} elseif (($c >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN) |
|
@@ 2696-2699 (lines=4) @@
|
| 2693 |
|
} elseif (($c >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN) |
| 2694 |
|
$bytes[] = ($c - 0xE0) << 0x0C; |
| 2695 |
|
$numbytes = 3; |
| 2696 |
|
} elseif (($c >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN) |
| 2697 |
|
$bytes[] = ($c - 0xF0) << 0x12; |
| 2698 |
|
$numbytes = 4; |
| 2699 |
|
} else { |
| 2700 |
|
// use replacement character for other invalid sequences |
| 2701 |
|
$unicode[] = 0xFFFD; |
| 2702 |
|
$bytes = array(); |