Detailed parsing of URL encoding problems containing Chinese characters

Source: Internet
Author: User
In xml applications, some URL information is often stored as xml data. the URL parameter may contain Chinese characters. When you use dom to parse xml data, you can encode Chinese characters. In xml applications, some URL information is often stored as xml data. the URL parameter may contain Chinese characters. When you use dom to parse xml data, you can encode Chinese characters.
However, if only xslt is used to display xml data (data. xml + data. xsl). the encoding error is found in the URL at this time. even if the encoding type is specified (encoding = "gb2312"), the same problem still occurs.
Test results show that the cache mechanism of IE is incorrect. IE still sets the MIME content type of the new page (URL linked) to text/xml by default.

Solution:
1. specify the output document type as xml document (example: data. xsl)

 

2. Open in a new window, add properties to the join, and specify the target window as another window (example: data2.xsl)

 
 
  
_ Blank
 Examples:/*** data. xml ***/
 
 
  
    
   
    
Http://www.google.com/search? Q = </url>
    
     
Xml data
     
   
   
    
   
    
Http://www1.baidu.com/baidu? Word = </url>
    
     
Xml data
     
   
   
    
   
    
Http://www.google.com/search? Q = </url>
    
     
Extreme Programming (xp)
     
   
   
    
   
    
Http://www1.baidu.com/baidu? Word = </url>
    
     
Extreme Programming (xp)
     
   
  
 /*** Data. xsl ***/
 
 
  
  
   
     
  
   
     
    
     
     
      
     
    
   
/*** Data2.xsl ***/ _ Blank

The above is a detailed explanation of the URL encoding problem that contains Chinese characters. For more information, see PHP Chinese website (www.php1.cn )!

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.