Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3946477
D3607.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
899 B
Referenced Files
None
Subscribers
None
D3607.diff
View Options
diff --git a/helpers/Encoding.php b/helpers/Encoding.php
--- a/helpers/Encoding.php
+++ b/helpers/Encoding.php
@@ -184,11 +184,11 @@
$max = strlen($text);
$buf = "";
for($i = 0; $i < $max; $i++){
- $c1 = $text{$i};
+ $c1 = $text[$i];
if($c1>="\xc0"){ //Should be converted to UTF8, if it's not UTF8 already
- $c2 = $i+1 >= $max? "\x00" : $text{$i+1};
- $c3 = $i+2 >= $max? "\x00" : $text{$i+2};
- $c4 = $i+3 >= $max? "\x00" : $text{$i+3};
+ $c2 = $i+1 >= $max? "\x00" : $text[$i+1];
+ $c3 = $i+2 >= $max? "\x00" : $text[$i+2];
+ $c4 = $i+3 >= $max? "\x00" : $text[$i+3];
if($c1 >= "\xc0" & $c1 <= "\xdf"){ //looks like 2 bytes UTF8
if($c2 >= "\x80" && $c2 <= "\xbf"){ //yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 17:45 (8 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2317148
Default Alt Text
D3607.diff (899 B)
Attached To
Mode
D3607: Use brackets to access array elements
Attached
Detach File
Event Timeline
Log In to Comment