Changeset 10 for Common/UTF8.php
- Timestamp:
- Apr 7, 2020, 8:52:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UTF8.php
r4 r10 529 529 { 530 530 $Result = ''; 531 for ($I = 0; $I < strlen($String); $I++)531 for ($I = 0; $I < strlen($String); $I++) 532 532 { 533 if (ord($String[$I]) < 128) $Result .= $String[$I];534 else if (ord($String[$I]) > 127)533 if (ord($String[$I]) < 128) $Result .= $String[$I]; 534 else if (ord($String[$I]) > 127) 535 535 { 536 536 $Result .= $this->CharTable[$Charset][ord($String[$I])]; 537 537 } 538 538 } 539 return ($Result);539 return $Result; 540 540 } 541 541 … … 544 544 $Result = ''; 545 545 $UTFPrefix = ''; 546 for ($I = 0; $I < strlen($String); $I++)546 for ($I = 0; $I < strlen($String); $I++) 547 547 { 548 if (ord($String{$I}) & 0x80) // UTF control character548 if (ord($String{$I}) & 0x80) // UTF control character 549 549 { 550 if (ord($String{$I}) & 0x40) // First550 if (ord($String{$I}) & 0x40) // First 551 551 { 552 if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset]));552 if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset])); 553 553 $UTFPrefix = $String{$I}; 554 554 } … … 556 556 } else 557 557 { 558 if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset]));558 if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset])); 559 559 $UTFPrefix = ''; 560 560 $Result .= $String{$I}; 561 561 } 562 562 } 563 return ($Result);563 return $Result; 564 564 } 565 565 }
Note:
See TracChangeset
for help on using the changeset viewer.