Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return parameters are double utf-encoded #211

Open
f-p-r opened this issue Nov 14, 2024 · 3 comments
Open

Return parameters are double utf-encoded #211

f-p-r opened this issue Nov 14, 2024 · 3 comments

Comments

@f-p-r
Copy link

f-p-r commented Nov 14, 2024

Just doing first steps with IbmiToolkit, i modified call-procedure.php script in samples for testing. It works, but character parameters (ie $params[] = $conn->AddParameterChar('both', 20,'Parm', 'PARM', ''); ) are returned with 'double utf-8 encoding'. That is, i had to perform mb_convert_encoding($result['io_param']['PARM'], 'ISO-8859-1', 'UTF-8') to get the right parameter value in utf-8. I verified that the script is utf-8 encoded, with some special chars hardcoded that show ok in the html result page, which even has defined charset="UTF-8" as meta to make sure it displays content in utf-8 encoding.

Maybe it's a config issue?

@alanseiden
Copy link
Collaborator

@f-p-r Could you create a debug log of the program call and post it here? Instructions:

$conn->setOptions(array('debug' => true,

@f-p-r
Copy link
Author

f-p-r commented Nov 15, 2024 via email

@f-p-r
Copy link
Author

f-p-r commented Nov 15, 2024

Sorry, looks like the attached file of my email is not available in this chat. I copy the contents:

Exec start: 2024-11-15 12:02:35
Version of toolkit front end: 1.9.3
IPC: ''. Control key: *cdata *here
Stmt: call QXMLSERV.iPLUG512K(?,?,?,?) with transport: ibm_db2
Input XML: <?xml version="1.0" encoding="ISO-8859-1" ?>
<script>
<pgm name='PGM' lib='LIB' >
<parm io='in' comment='Entrada'><data var='ENTRADA' type='7p2'>1234.56</data></parm>
<parm comment='Salida'><data var='SALIDA' type='10A' /></parm>
<parm comment='Salida2'><data var='SALIDA2' type='20A'>123asdÑç</data></parm>
</pgm>
</script>
Output XML: <?xml version="1.0" encoding="ISO-8859-1" ?>
<script>
<pgm name='PGM' lib='LIB' >
<parm comment='Salida'>
<data var='SALIDA' type='10A' ><![CDATA[1234.56Ñ]]></data>
</parm>
<parm comment='Salida2'>
<data var='SALIDA2' type='20A'><![CDATA[123asdÑçÑá]]></data>
</parm>
<success><![CDATA[+++ success LIB PGM ]]></success>
</pgm>
</script>
Exec end: 2024-11-15 12:02:35. Seconds to execute: 0.052284002304077.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants