php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17792 DOMXML outputs ? character before ? - encoding??
Submitted: 2002-06-16 18:02 UTC Modified: 2002-06-17 10:39 UTC
From: douglas_devine at yahoo dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.2.1 OS: Redhat 7.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: douglas_devine at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-06-16 18:02 UTC] douglas_devine at yahoo dot com
I have a web page with a form. I want the user to be able to use the ? symbol in a text field on the form. I then pass the value of the text field(the ? symbol) to a DOMXML function which creates a XML string which is transformed into XHTML using the XSLT functions.

I have a meta tag defining the encoding of the web page as UTF-8. (So the ? symbol is being passed into the DOMXML function in this format? I echo it out just before doing this and it displays correctly.)

the DOMXML functions use UTF-8 for input and output? When I echo the XML output before passing it to the XSLT functions, I see that it has placed a ? symbol immediately before the ? symbol.

Seems like there might be an encoding problem?

Using Sablotron-0.90, Expat-1.95.3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-17 04:56 UTC] chregu@php.net
Could you please give a short code example, which reproduces this problem. 

And domxml expects and outputs utf8 by default. try it with converting your input to utf-8 before using it with domxml.




 [2002-06-17 10:39 UTC] jtate@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Remember that echo's output is ascii.  The ? symbol is not ascii.  Since it's not it is expanded to two bytes.  ? is that second byte.  A true test would be to parse it and output the string that is retrieved.  For a list of what is ascii, and therefore is unchanged when output to UTF-8 see http://www.mindspring.com/~jc1/serial/Resources/ASCII.html
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC