2011/2/10 David DURIEUX <span dir="ltr">&lt;<a href="mailto:d.durieux@siprossii.com">d.durieux@siprossii.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br></blockquote><div><br>Linvinus pointed out some issue with the code.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
For example, I have try with RU inventory but not works with these two<br>
codes :<br>
<br>
if (strstr(gzuncompress($GLOBALS[&quot;HTTP_RAW_POST_DATA&quot;]),&#39;encoding=&quot;ISO-8859-1&quot;&#39;)) { </blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

   $data = gzuncompress($GLOBALS[&quot;HTTP_RAW_POST_DATA&quot;]); <br></blockquote><div>You call  gzuncompress two time in a row here. It&#39;s useless. For your information, since OCS 1.02, the agent can also push uncompressed XML.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
   $from_charset=mb_detect_encoding($data, &quot;auto&quot;);<br></blockquote><div>This will never work as expected :( The server administrator has to set $from_charset by hisself.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

   $data = mb_convert_encoding($data,&quot;UTF-8&quot;,$from_charset);<br>
   $GLOBALS[&quot;HTTP_RAW_POST_DATA&quot;] = gzcompress($data);<br></blockquote><div>This is not a good idea. You should never change the GLOBALS var content.<br></div></div><br clear="all">Cheers<br>-- <br>     Gonéri Le Bouder<br>