| @@ 453-457 (lines=5) @@ | ||
| 450 | $remaining = 1; |
|
| 451 | } |
|
| 452 | // Three byte sequence: |
|
| 453 | elseif (($value & 0xF0) === 0xE0) { |
|
| 454 | $character = ($value & 0x0F) << 12; |
|
| 455 | $length = 3; |
|
| 456 | $remaining = 2; |
|
| 457 | } |
|
| 458 | // Four byte sequence: |
|
| 459 | elseif (($value & 0xF8) === 0xF0) { |
|
| 460 | $character = ($value & 0x07) << 18; |
|
| @@ 459-463 (lines=5) @@ | ||
| 456 | $remaining = 2; |
|
| 457 | } |
|
| 458 | // Four byte sequence: |
|
| 459 | elseif (($value & 0xF8) === 0xF0) { |
|
| 460 | $character = ($value & 0x07) << 18; |
|
| 461 | $length = 4; |
|
| 462 | $remaining = 3; |
|
| 463 | } |
|
| 464 | // Invalid byte: |
|
| 465 | else { |
|
| 466 | $valid = false; |
|
| @@ 574-578 (lines=5) @@ | ||
| 571 | $length = 1; |
|
| 572 | } |
|
| 573 | // Two byte sequence: |
|
| 574 | elseif (($value & 0xE0) === 0xC0) { |
|
| 575 | $character = ($value & 0x1F) << 6; |
|
| 576 | $length = 2; |
|
| 577 | $remaining = 1; |
|
| 578 | } |
|
| 579 | // Three byte sequence: |
|
| 580 | elseif (($value & 0xF0) === 0xE0) { |
|
| 581 | $character = ($value & 0x0F) << 12; |
|
| @@ 580-584 (lines=5) @@ | ||
| 577 | $remaining = 1; |
|
| 578 | } |
|
| 579 | // Three byte sequence: |
|
| 580 | elseif (($value & 0xF0) === 0xE0) { |
|
| 581 | $character = ($value & 0x0F) << 12; |
|
| 582 | $length = 3; |
|
| 583 | $remaining = 2; |
|
| 584 | } |
|
| 585 | // Four byte sequence: |
|
| 586 | elseif (($value & 0xF8) === 0xF0) { |
|
| 587 | $character = ($value & 0x07) << 18; |
|
| @@ 586-590 (lines=5) @@ | ||
| 583 | $remaining = 2; |
|
| 584 | } |
|
| 585 | // Four byte sequence: |
|
| 586 | elseif (($value & 0xF8) === 0xF0) { |
|
| 587 | $character = ($value & 0x07) << 18; |
|
| 588 | $length = 4; |
|
| 589 | $remaining = 3; |
|
| 590 | } |
|
| 591 | // Invalid byte: |
|
| 592 | else { |
|
| 593 | $valid = false; |
|
| @@ 155-159 (lines=5) @@ | ||
| 152 | $remaining = 0; |
|
| 153 | } |
|
| 154 | // Two byte sequence: |
|
| 155 | elseif (($value & 0xE0) === 0xC0) { |
|
| 156 | $character = ($value & 0x1F) << 6; |
|
| 157 | $length = 2; |
|
| 158 | $remaining = 1; |
|
| 159 | } |
|
| 160 | // Three byte sequence: |
|
| 161 | elseif (($value & 0xF0) === 0xE0) { |
|
| 162 | $character = ($value & 0x0F) << 12; |
|
| @@ 161-165 (lines=5) @@ | ||
| 158 | $remaining = 1; |
|
| 159 | } |
|
| 160 | // Three byte sequence: |
|
| 161 | elseif (($value & 0xF0) === 0xE0) { |
|
| 162 | $character = ($value & 0x0F) << 12; |
|
| 163 | $length = 3; |
|
| 164 | $remaining = 2; |
|
| 165 | } |
|
| 166 | // Four byte sequence: |
|
| 167 | elseif (($value & 0xF8) === 0xF0) { |
|
| 168 | $character = ($value & 0x07) << 18; |
|
| @@ 167-171 (lines=5) @@ | ||
| 164 | $remaining = 2; |
|
| 165 | } |
|
| 166 | // Four byte sequence: |
|
| 167 | elseif (($value & 0xF8) === 0xF0) { |
|
| 168 | $character = ($value & 0x07) << 18; |
|
| 169 | $length = 4; |
|
| 170 | $remaining = 3; |
|
| 171 | } |
|
| 172 | // Invalid byte: |
|
| 173 | else { |
|
| 174 | throw new Requests_Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $value); |
|