Bug #75416 [Opn->Nab]: Hebrew chars don't convert as expected

From: Date: Thu, 04 Feb 2021 18:15:05 +0000
Subject: Bug #75416 [Opn->Nab]: Hebrew chars don't convert as expected
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231955@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75416&edit=1

 ID:                 75416
 Updated by:         cmb@php.net
 Reported by:        chmodxwr at gmail dot com
 Summary:            Hebrew chars don't convert as expected
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            XMLRPC-EPI related
 Operating System:   any
 PHP Version:        any
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> How can I make it as a default on php.ini/xmlrpc.ini file ?

To my knowledge, you can't.  Write a wrapper function, or better
stop using the XMLRPC extension[1], if you haven't already.

[1] <https://wiki.php.net/rfc/unbundle_xmlprc>


Previous Comments:
------------------------------------------------------------------------
[2017-10-25 03:34:13] chmodxwr at gmail dot com

change php version and OS

------------------------------------------------------------------------
[2017-10-23 10:59:51] chmodxwr at gmail dot com

update:
on xmlrpc :
the escaping=>"markup" resolve the problem.

Now : How can I make it as a default on php.ini/xmlrpc.ini file ?

------------------------------------------------------------------------
[2017-10-23 05:34:25] chmodxwr at gmail dot com

Hello

yes the escaping  as a "markup"  solve the problem.

their anyway  to add this to php.ini / xmlrpc.ini as a default ?

thank you 

Nir

------------------------------------------------------------------------
[2017-10-22 16:50:35] kalle@php.net

Keep in note that this function is marked as 'EXPERIMENTAL'. Although I would argue that
is not true anymore.

Anyway! Have you tried to set the 'escaping' option in the $output_options parameter of
xmlrpc_encode_request()?

------------------------------------------------------------------------
[2017-10-22 16:31:48] chmodxwr at gmail dot com

Description:
------------
---
From manual page:http://php.net/manual/en/function.xmlrpc-encode-request.php

---

the convert from array to xmlrpc_encode_request dont convert the hebrew characters as need to 

after convert to xmlrpc_request 
the word שלום looks like this : 
 &#215;&#169;&#215;&#156;&#215;&#149;&#215;&#157; -- wrong encoding 

the word Hello looks good
Hello



Test script:
---------------
<?php


$array= [
            ['Server' => 'BM',
                'Method' => test,
                'Params' => ['שלום',hello,12],
            ]
        ];

$bug = xmlrpc_encode_request('Execute', $array, ['encoding' =>
'utf-8', 'version' => 'xmlrpc']);


?>


Expected result:
----------------
the name: שלום looks incorrect with wrong chars

the name: hello  looks good


 <?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>Execute</methodName>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>Server</name>
     <value>
      <string>BM</string>
     </value>
    </member>
    <member>
     <name>Method</name>
     <value>
      <string>test</string>
     </value>
    </member>
    <member>
     <name>Params</name>
     <value>
      <array>
       <data>
        <value>
         <string>שלום</string>
        </value>
        <value>
        <string>hello</string>
         </value>
       </data>
      </array>
     </value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodCall>

Actual result:
--------------
 <?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>Execute</methodName>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>Server</name>
     <value>
      <string>BM</string>
     </value>
    </member>
    <member>
     <name>Method</name>
     <value>
      <string>test</string>
     </value>
    </member>
    <member>
     <name>Params</name>
     <value>
      <array>
       <data>
        <value>
        
<string>&#215;&#169;&#215;&#156;&#215;&#149;&#215;&#157;</string>
        </value>
        <value>
        <string>hello</string>
         </value>
       </data>
      </array>
     </value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodCall>


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75416&edit=1


Thread (6 messages)

« previous php.bugs (#231955) next »