Is the nagging boss still there? XML parsing error, 5555

Source: Internet
Author: User
Tags cdata
Is the nagging boss still there? XML parsing error Help, 5555

ka 咓 吚.

How do I make sure that the characters in the tag conform to XML? What to do with it?
It's really hard to make sure that the XML document is accurate so that it can parse the XML parsing function of PHP
There are no XML parsers like the regular.
I just want to parse this document, how to remove/change these characters? What characters are included in these characters?

Thank you

------Solution--------------------
There should be no problem with UTF-8.

1. Replace

ka 咓 吚.

2. Save the XML file in the Utf-8 format with a notebook

The 3.PHP file itself is also saved in Notepad as Utf-8

4. Add the header to the PHP file
Header (' Content-type:text/html;charset=utf-8 ');


Welcome to join PHP enthusiasts QQ Group: 30169840
------Solution--------------------
hehe, UTF-8 encoding format should have no problem.
However, it is estimated that the landlord does not like UTF-8 this format bar.

------Solution--------------------
I'll help you top up. Look forward to the answer.
------Solution--------------------
咔咓吚.
------Solution--------------------
Do not utf-8 code also can, I write the program, only PHP program, code is gb2312, just start also reported coding error that, later changed to Utf-8 No, the results are changed to gb2312 just fine! Some people say, it seems as long as a few pages to ensure that the code is consistent, the specific still needs to be verified!
------Solution--------------------
Jom_ch answered the point.
Just csdn automatically turns "<" into "<".


咔咓吚 </test> .]] > </xml>
------Solution--------------------
$str = " ka 咓 吚. ";
//.....
$str = Preg_replace ("/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/", "', $str);
$str = Htmlspecialchars ($STR);
------Solution--------------------
There's a mistake.
Htmlspecialchars should go ahead and put the code in In the
------Solution--------------------
Oh, I generally do:

function Sbc_dbc ($STR)
{
----Full angle to half-width----
$Queue = Array (
' 0 ' = ' 0 ', ' 1 ' = ' 1 ', ' 2 ' = ' 2 ', ' 3 ' = ' 3 ', ' 4 ' = ' 4 ',
' 5 ' = ' 5 ', ' 6 ' = ' 6 ', ' 7 ' = ' 7 ', ' 8 ' = ' 8 ', ' 9 ' = ' 9 ',
' A ' = ' a ', ' B ' = ' B ', ' c ' = ' C ', ' d ' and '-d ', ' e ' = ' e ',
' F ' = ' f ', ' g ' = ' g ', ' h ' = = ' h ', ' i ' = ' I ', ' j ' = ' j ',
' k ' = ' k ', ' l ' = ' + ', ' m ' = = ' m ', ' n ' = ' n ', ' o ' = ' ' O ',
' P ' = ' P ', ' q ' + = ' q ', ' r ' = = ' R ', ' s ' = + ' s ', ' t ' = ' t ',
' U ' = ' ' u ', ' v ' = ' = ' V ', ' w ' = = ' W ', ' x ' = ' x ', ' y ' = ' y ',
' Z ' + ' z ', ' a ' = ' = ' A ', ' B ' = ' B ', ' c ' = ' C ', ' d ' = = ' d ',
' E ' = ' e ', ' f ' = ' f ', ' g ' = ' = ' g ', ' h ' = ' h ', ' i ' = = ' I ',
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.