Fix problem with 2-byte charsets (eg UTF-16) in t3lib_cs::utf8_encode().
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 3 May 2006 08:47:30 +0000 (08:47 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 3 May 2006 08:47:30 +0000 (08:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1460 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_cs.php

index b635306..d82adc4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 
 2006-04-29  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
-       Fix typolink.addQueryString.method=GET (see bug #3241)
+       * Fix typolink.addQueryString.method=GET (see bug #3241)
+       * Fix problem with 2-byte charsets (eg UTF-16) in t3lib_cs::utf8_encode().
 
 2006-05-03   Rupert Germann  <rupi@gmx.li>
 
index 0e24cf6..fb0def3 100755 (executable)
@@ -667,7 +667,7 @@ class t3lib_cs {
                                $ord=ord($chr);
                                if (isset($this->twoByteSets[$charset]))        {       // If the charset has two bytes per char
                                        $ord2 = ord($str{$a+1});
-                                       $ord = $ord<<8 & $ord2; // assume big endian
+                                       $ord = $ord<<8 | $ord2; // assume big endian
 
                                        if (isset($this->parsedCharsets[$charset]['local'][$ord]))      {       // If the local char-number was found in parsed conv. table then we use that, otherwise 127 (no char?)
                                                $outStr.=$this->parsedCharsets[$charset]['local'][$ord];