<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: LZW compression methods in AS2</title>
	<atom:link href="http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/</link>
	<description>since 2004!</description>
	<lastBuildDate>Fri, 29 Jan 2010 09:21:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: MoMo-Studio Development Blog &#187; Blog Archive &#187; XML can be compress (LZW) to reduce file size</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3447</link>
		<dc:creator>MoMo-Studio Development Blog &#187; Blog Archive &#187; XML can be compress (LZW) to reduce file size</dc:creator>
		<pubDate>Fri, 29 Jan 2010 09:21:19 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3447</guid>
		<description>[...] http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/" rel="nofollow">http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ast Derek</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3418</link>
		<dc:creator>Ast Derek</dc:creator>
		<pubDate>Tue, 05 Jan 2010 23:03:37 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3418</guid>
		<description>Too late I found this site, it is a very good reference but most users are not comenting any more. I had a similar problem as Yehia, PHP was not decompressing the right string.

After some debugging, the difference between the AS compress and the PHP decompress was: my AS had the &#039;xmlsafe&#039; option set to true but PHP was not managing that offset, so all values were 5 units bigger than they should. After deactivating the option the problems were gone.</description>
		<content:encoded><![CDATA[<p>Too late I found this site, it is a very good reference but most users are not comenting any more. I had a similar problem as Yehia, PHP was not decompressing the right string.</p>
<p>After some debugging, the difference between the AS compress and the PHP decompress was: my AS had the 'xmlsafe' option set to true but PHP was not managing that offset, so all values were 5 units bigger than they should. After deactivating the option the problems were gone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emre dagli</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3349</link>
		<dc:creator>emre dagli</dc:creator>
		<pubDate>Sun, 10 May 2009 19:00:43 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3349</guid>
		<description>In server side I need to decompress. 
I correct cakeWho code as following:
for loop start index 0 --&gt; 1
        public static string decompress(string str)
        {
            string[] dico = new string[100000];
            int skipnum = 0;

            for (int i = 0; i &lt; 256; i++)
            {
                string c = char.ConvertFromUtf32(i);
                dico[i] = c;
            }

            string txt2encode = str;
            string splitStr = txt2encode;
            int length = splitStr.Length;
            int nbChar = 256 + skipnum;
            string buffer = &quot;&quot;;
            string chaine = &quot;&quot;;
            String result = &quot;&quot;;
            string current = &quot;&quot;;
            int code = 0;
            string undefined = dico[nbChar];

            code = char.ConvertToUtf32(txt2encode[0].ToString(), 0);
            current = dico[code];

            buffer = current.ToString();
            result += current;

            for (int i = 1; i &lt; length; i++)
            {

                code = char.ConvertToUtf32(txt2encode[i].ToString(), 0);

                current = dico[code];
                if (code &lt;= 255 + skipnum)
                {
                    result += current;
                    chaine = buffer + current;

                    dico[nbChar] = chaine;
                    nbChar++;
                    buffer = current;
                }
                else
                {

                    if (dico[code] == undefined)
                    {
                        chaine = buffer + buffer[0].ToString();
                        result += chaine;
                        dico[nbChar] = buffer + chaine[0].ToString();
                    }
                    else
                    {
                        chaine = dico[code];
                        result += chaine;
                        dico[nbChar] = buffer + chaine[0].ToString();
                    }
                    nbChar++;
                    buffer = chaine;
                }

            }
            return result;
        }</description>
		<content:encoded><![CDATA[<p>In server side I need to decompress.<br />
I correct cakeWho code as following:<br />
for loop start index 0 --&gt; 1<br />
        public static string decompress(string str)<br />
        {<br />
            string[] dico = new string[100000];<br />
            int skipnum = 0;</p>
<p>            for (int i = 0; i &lt; 256; i++)<br />
            {<br />
                string c = char.ConvertFromUtf32(i);<br />
                dico[i] = c;<br />
            }</p>
<p>            string txt2encode = str;<br />
            string splitStr = txt2encode;<br />
            int length = splitStr.Length;<br />
            int nbChar = 256 + skipnum;<br />
            string buffer = "";<br />
            string chaine = "";<br />
            String result = "";<br />
            string current = "";<br />
            int code = 0;<br />
            string undefined = dico[nbChar];</p>
<p>            code = char.ConvertToUtf32(txt2encode[0].ToString(), 0);<br />
            current = dico[code];</p>
<p>            buffer = current.ToString();<br />
            result += current;</p>
<p>            for (int i = 1; i &lt; length; i++)<br />
            {</p>
<p>                code = char.ConvertToUtf32(txt2encode[i].ToString(), 0);</p>
<p>                current = dico[code];<br />
                if (code &lt;= 255 + skipnum)<br />
                {<br />
                    result += current;<br />
                    chaine = buffer + current;</p>
<p>                    dico[nbChar] = chaine;<br />
                    nbChar++;<br />
                    buffer = current;<br />
                }<br />
                else<br />
                {</p>
<p>                    if (dico[code] == undefined)<br />
                    {<br />
                        chaine = buffer + buffer[0].ToString();<br />
                        result += chaine;<br />
                        dico[nbChar] = buffer + chaine[0].ToString();<br />
                    }<br />
                    else<br />
                    {<br />
                        chaine = dico[code];<br />
                        result += chaine;<br />
                        dico[nbChar] = buffer + chaine[0].ToString();<br />
                    }<br />
                    nbChar++;<br />
                    buffer = chaine;<br />
                }</p>
<p>            }<br />
            return result;<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emre dagli</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3348</link>
		<dc:creator>emre dagli</dc:creator>
		<pubDate>Sun, 10 May 2009 18:58:34 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3348</guid>
		<description>Previous reply was not good so rewrite the message:
My lcw compression algorithm is:
// LZW-compress a string
function lzw_encode(s) {
	var d = new Date();
	
    var dict = {};
    var data = (s + &quot;&quot;).split(&quot;&quot;);
    var out = [];
    var currChar;
    var phrase = data[0];
    var code = 256;
    for (var i=1; i 1 ? dict[phrase] : phrase.charCodeAt(0));
            dict[phrase + currChar] = code;
            code++;
            phrase=currChar;
        }
    }
    out.push(phrase.length &gt; 1 ? dict[phrase] : phrase.charCodeAt(0));
    for (var i=0; i&lt;out.length; i++) {
        out[i] = String.fromCharCode(out[i]);
    }
	
    var retrunedresult = out.join(&quot;&quot;);
	console.log(&quot;Input: &quot; + s.length/1024 + &quot;kb Output:&quot;+ retrunedresult.length/1024 + &quot;kb Rate: &quot; +(s.length/retrunedresult.length) );
	console.log((new Date()).getTime() - d.getTime() + &#039; ms.&#039;);
	return retrunedresult;
}</description>
		<content:encoded><![CDATA[<p>Previous reply was not good so rewrite the message:<br />
My lcw compression algorithm is:<br />
// LZW-compress a string<br />
function lzw_encode(s) {<br />
	var d = new Date();</p>
<p>    var dict = {};<br />
    var data = (s + "").split("");<br />
    var out = [];<br />
    var currChar;<br />
    var phrase = data[0];<br />
    var code = 256;<br />
    for (var i=1; i 1 ? dict[phrase] : phrase.charCodeAt(0));<br />
            dict[phrase + currChar] = code;<br />
            code++;<br />
            phrase=currChar;<br />
        }<br />
    }<br />
    out.push(phrase.length &gt; 1 ? dict[phrase] : phrase.charCodeAt(0));<br />
    for (var i=0; i&lt;out.length; i++) {<br />
        out[i] = String.fromCharCode(out[i]);<br />
    }</p>
<p>    var retrunedresult = out.join("");<br />
	console.log("Input: " + s.length/1024 + "kb Output:"+ retrunedresult.length/1024 + "kb Rate: " +(s.length/retrunedresult.length) );<br />
	console.log((new Date()).getTime() - d.getTime() + ' ms.');<br />
	return retrunedresult;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emre dagli</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3347</link>
		<dc:creator>emre dagli</dc:creator>
		<pubDate>Sun, 10 May 2009 18:55:16 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3347</guid>
		<description>I am using following code in javascript for lcw compresion:

function lzw_encode(s) {
	var d = new Date();
	
    var dict = {};
    var data = (s + &quot;&quot;).split(&quot;&quot;);
    var out = [];
    var currChar;
    var phrase = data[0];
    var code = 256;
    for (var i=1; i 1 ? dict[phrase] : phrase.charCodeAt(0));
            dict[phrase + currChar] = code;
            code++;
            phrase=currChar;
        }
    }
    out.push(phrase.length &gt; 1 ? dict[phrase] : phrase.charCodeAt(0));
    for (var i=0; i 1. The corrected version is:

        public static string decompress(string str)
        {
            string[] dico = new string[100000];
            int skipnum = 0;

            for (int i = 0; i &lt; 256; i++)
            {
                string c = char.ConvertFromUtf32(i);
                dico[i] = c;
            }

            string txt2encode = str;
            string splitStr = txt2encode;
            int length = splitStr.Length;
            int nbChar = 256 + skipnum;
            string buffer = &quot;&quot;;
            string chaine = &quot;&quot;;
            String result = &quot;&quot;;
            string current = &quot;&quot;;
            int code = 0;
            string undefined = dico[nbChar];

            code = char.ConvertToUtf32(txt2encode[0].ToString(), 0);
            current = dico[code];

            buffer = current.ToString();
            result += current;

            for (int i = 1; i &lt; length; i++)
            {

                code = char.ConvertToUtf32(txt2encode[i].ToString(), 0);

                current = dico[code];
                if (code &lt;= 255 + skipnum)
                {
                    result += current;
                    chaine = buffer + current;

                    dico[nbChar] = chaine;
                    nbChar++;
                    buffer = current;
                }
                else
                {

                    if (dico[code] == undefined)
                    {
                        chaine = buffer + buffer[0].ToString();
                        result += chaine;
                        dico[nbChar] = buffer + chaine[0].ToString();
                    }
                    else
                    {
                        chaine = dico[code];
                        result += chaine;
                        dico[nbChar] = buffer + chaine[0].ToString();
                    }
                    nbChar++;
                    buffer = chaine;
                }

            }
            return result;
        }</description>
		<content:encoded><![CDATA[<p>I am using following code in javascript for lcw compresion:</p>
<p>function lzw_encode(s) {<br />
	var d = new Date();</p>
<p>    var dict = {};<br />
    var data = (s + "").split("");<br />
    var out = [];<br />
    var currChar;<br />
    var phrase = data[0];<br />
    var code = 256;<br />
    for (var i=1; i 1 ? dict[phrase] : phrase.charCodeAt(0));<br />
            dict[phrase + currChar] = code;<br />
            code++;<br />
            phrase=currChar;<br />
        }<br />
    }<br />
    out.push(phrase.length &gt; 1 ? dict[phrase] : phrase.charCodeAt(0));<br />
    for (var i=0; i 1. The corrected version is:</p>
<p>        public static string decompress(string str)<br />
        {<br />
            string[] dico = new string[100000];<br />
            int skipnum = 0;</p>
<p>            for (int i = 0; i &lt; 256; i++)<br />
            {<br />
                string c = char.ConvertFromUtf32(i);<br />
                dico[i] = c;<br />
            }</p>
<p>            string txt2encode = str;<br />
            string splitStr = txt2encode;<br />
            int length = splitStr.Length;<br />
            int nbChar = 256 + skipnum;<br />
            string buffer = "";<br />
            string chaine = "";<br />
            String result = "";<br />
            string current = "";<br />
            int code = 0;<br />
            string undefined = dico[nbChar];</p>
<p>            code = char.ConvertToUtf32(txt2encode[0].ToString(), 0);<br />
            current = dico[code];</p>
<p>            buffer = current.ToString();<br />
            result += current;</p>
<p>            for (int i = 1; i &lt; length; i++)<br />
            {</p>
<p>                code = char.ConvertToUtf32(txt2encode[i].ToString(), 0);</p>
<p>                current = dico[code];<br />
                if (code &lt;= 255 + skipnum)<br />
                {<br />
                    result += current;<br />
                    chaine = buffer + current;</p>
<p>                    dico[nbChar] = chaine;<br />
                    nbChar++;<br />
                    buffer = current;<br />
                }<br />
                else<br />
                {</p>
<p>                    if (dico[code] == undefined)<br />
                    {<br />
                        chaine = buffer + buffer[0].ToString();<br />
                        result += chaine;<br />
                        dico[nbChar] = buffer + chaine[0].ToString();<br />
                    }<br />
                    else<br />
                    {<br />
                        chaine = dico[code];<br />
                        result += chaine;<br />
                        dico[nbChar] = buffer + chaine[0].ToString();<br />
                    }<br />
                    nbChar++;<br />
                    buffer = chaine;<br />
                }</p>
<p>            }<br />
            return result;<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yehia</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3157</link>
		<dc:creator>Yehia</dc:creator>
		<pubDate>Wed, 16 Jul 2008 16:46:44 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3157</guid>
		<description>People PLEASE, I am suffering here, any of the above php code doesn&#039;t decode correctly. is that relevant to code page or what  that is different on the server than my client ? the character codes are the root of evil. the numbers i get for the same string on AS2 is different than Php. my solution has to be AS2 based.

Please email me back
yehia.shouman@gmail.com</description>
		<content:encoded><![CDATA[<p>People PLEASE, I am suffering here, any of the above php code doesn't decode correctly. is that relevant to code page or what  that is different on the server than my client ? the character codes are the root of evil. the numbers i get for the same string on AS2 is different than Php. my solution has to be AS2 based.</p>
<p>Please email me back<br />
<a href="mailto:yehia.shouman@gmail.com">yehia.shouman@gmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: venkateshwarlu</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3090</link>
		<dc:creator>venkateshwarlu</dc:creator>
		<pubDate>Mon, 05 May 2008 07:56:53 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3090</guid>
		<description>:roll: yeh this is great example for compression and uncompress of data
 using LZW algorithm iwant the C#.net implementation of the LZW algorithm so that i can compress in flex and un compress in c#
and again compress in c# an un compress in Flex</description>
		<content:encoded><![CDATA[<p> <img src='http://www.razorberry.com/blog/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  yeh this is great example for compression and uncompress of data<br />
 using LZW algorithm iwant the C#.net implementation of the LZW algorithm so that i can compress in flex and un compress in c#<br />
and again compress in c# an un compress in Flex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: axaq</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-3035</link>
		<dc:creator>axaq</dc:creator>
		<pubDate>Tue, 18 Mar 2008 15:01:40 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-3035</guid>
		<description>Hi, 
I have used the code you have modified on FP9 and I get the slow down error when tried to compress a bitmap image data. 
I have the hexadecimal data of a bitmap image and I want to compress this data. Can you help me about this? Is there any thing to optimize the compressor?

thanks</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have used the code you have modified on FP9 and I get the slow down error when tried to compress a bitmap image data.<br />
I have the hexadecimal data of a bitmap image and I want to compress this data. Can you help me about this? Is there any thing to optimize the compressor?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-2313</link>
		<dc:creator>Ash</dc:creator>
		<pubDate>Thu, 24 Jan 2008 15:01:51 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-2313</guid>
		<description>Excellent! Thanks Billy.</description>
		<content:encoded><![CDATA[<p>Excellent! Thanks Billy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billy</title>
		<link>http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/comment-page-1/#comment-2312</link>
		<dc:creator>billy</dc:creator>
		<pubDate>Thu, 24 Jan 2008 02:00:29 +0000</pubDate>
		<guid isPermaLink="false">/?p=5#comment-2312</guid>
		<description>This is pretty much a literal translation into php and works for me.

You may need some extra libraries (for mb_* calls)

Here are the tricky parts to porting to PHP:
1.  ord/chr in php don&#039;t handle unicode (I&#039;ve included two functions thanks to the community on php.net)
2.  after preg_splitting with //g (to split unicode), there is a blank item in the beginning and end of the array (which i pop and shift off)
3.  I give this code without any warranty of its validity -- check everything before you use in production

function encode_lzw($str)
{
  $dico = array();

  for ($i = 0; $i &lt; 256; $i++)
  {
    $dico[unichr($i)] = $i;
  }

  $res = &quot;&quot;;
  $len = strlen($str);
  $nbChar = 256;
  $buffer = &quot;&quot;;

  for ($i = 0; $i &lt;= $len; $i++)
  {
    $current = $str[$i];
    if ($i &lt; strlen($str) &amp;&amp; $dico[$buffer . $current] !== null)
    {
      $buffer .= $current;
    }
    else
    {
      $res .= unichr($dico[$buffer]);
      $dico[$buffer . $current] = $nbChar;
      $nbChar++;
      $buffer = $current;
    }
  }

  return $res;
}

function decode_lzw($str)
{
  $dico = array();

  for ($i = 0; $i &lt; 256; $i++)
  {
    $c = unichr($i);
    $dico[$i] = $c;
  }

  $nbChar = 256;
  $buffer = &quot;&quot;;
  $chaine = &quot;&quot;;
  $result = &quot;&quot;;
  $strSplit = preg_split(&#039;//u&#039;, $str);
  array_pop($strSplit);
  array_shift($strSplit);

  $length   = count($strSplit);

  for ($i = 0; $i &lt; $length; $i++)
  {
    $code = uniord($strSplit[$i]);
    $current = $dico[$code];
    if ($buffer == &quot;&quot;)
    {
      $buffer = $current;
      $result .= $current;
    }
    else
    {
      if ($code &lt;= 255)
      {
        $result .= $current;
        $chaine = $buffer . $current;
        $dico[$nbChar] = $chaine;
        $nbChar++;
        $buffer = $current;
      }
      else
      {
        $chaine = $dico[$code];
        if ($chaine == &quot;&quot;) $chaine = $buffer . $buffer[0];
        $result .= $chaine;
        $dico[$nbChar] = $buffer . $chaine[0];
        $nbChar++;
        $buffer = $chaine;
      }
    }
  }

  return $result;
}

function unichr($u)
{
  $str = html_entity_decode(&#039;&amp;#&#039;.$u.&#039;;&#039;,ENT_NOQUOTES,&#039;UTF-8&#039;);
  return $str;
}

function uniord($u) {
  $k = mb_convert_encoding($u, &#039;UCS-2LE&#039;, &#039;UTF-8&#039;);
  $k1 = ord(substr($k, 0, 1));
  $k2 = ord(substr($k, 1, 1));
  return $k2 * 256 + $k1;
}</description>
		<content:encoded><![CDATA[<p>This is pretty much a literal translation into php and works for me.</p>
<p>You may need some extra libraries (for mb_* calls)</p>
<p>Here are the tricky parts to porting to PHP:<br />
1.  ord/chr in php don't handle unicode (I've included two functions thanks to the community on php.net)<br />
2.  after preg_splitting with //g (to split unicode), there is a blank item in the beginning and end of the array (which i pop and shift off)<br />
3.  I give this code without any warranty of its validity -- check everything before you use in production</p>
<p>function encode_lzw($str)<br />
{<br />
  $dico = array();</p>
<p>  for ($i = 0; $i &lt; 256; $i++)<br />
  {<br />
    $dico[unichr($i)] = $i;<br />
  }</p>
<p>  $res = "";<br />
  $len = strlen($str);<br />
  $nbChar = 256;<br />
  $buffer = "";</p>
<p>  for ($i = 0; $i &lt;= $len; $i++)<br />
  {<br />
    $current = $str[$i];<br />
    if ($i &lt; strlen($str) &amp;&amp; $dico[$buffer . $current] !== null)<br />
    {<br />
      $buffer .= $current;<br />
    }<br />
    else<br />
    {<br />
      $res .= unichr($dico[$buffer]);<br />
      $dico[$buffer . $current] = $nbChar;<br />
      $nbChar++;<br />
      $buffer = $current;<br />
    }<br />
  }</p>
<p>  return $res;<br />
}</p>
<p>function decode_lzw($str)<br />
{<br />
  $dico = array();</p>
<p>  for ($i = 0; $i &lt; 256; $i++)<br />
  {<br />
    $c = unichr($i);<br />
    $dico[$i] = $c;<br />
  }</p>
<p>  $nbChar = 256;<br />
  $buffer = "";<br />
  $chaine = "";<br />
  $result = "";<br />
  $strSplit = preg_split('//u', $str);<br />
  array_pop($strSplit);<br />
  array_shift($strSplit);</p>
<p>  $length   = count($strSplit);</p>
<p>  for ($i = 0; $i &lt; $length; $i++)<br />
  {<br />
    $code = uniord($strSplit[$i]);<br />
    $current = $dico[$code];<br />
    if ($buffer == "")<br />
    {<br />
      $buffer = $current;<br />
      $result .= $current;<br />
    }<br />
    else<br />
    {<br />
      if ($code &lt;= 255)<br />
      {<br />
        $result .= $current;<br />
        $chaine = $buffer . $current;<br />
        $dico[$nbChar] = $chaine;<br />
        $nbChar++;<br />
        $buffer = $current;<br />
      }<br />
      else<br />
      {<br />
        $chaine = $dico[$code];<br />
        if ($chaine == "") $chaine = $buffer . $buffer[0];<br />
        $result .= $chaine;<br />
        $dico[$nbChar] = $buffer . $chaine[0];<br />
        $nbChar++;<br />
        $buffer = $chaine;<br />
      }<br />
    }<br />
  }</p>
<p>  return $result;<br />
}</p>
<p>function unichr($u)<br />
{<br />
  $str = html_entity_decode('&amp;#'.$u.';',ENT_NOQUOTES,'UTF-8');<br />
  return $str;<br />
}</p>
<p>function uniord($u) {<br />
  $k = mb_convert_encoding($u, 'UCS-2LE', 'UTF-8');<br />
  $k1 = ord(substr($k, 0, 1));<br />
  $k2 = ord(substr($k, 1, 1));<br />
  return $k2 * 256 + $k1;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
