Home > Web Front-end > HTML Tutorial > : Conversion of Chinese character encoding in web pages_html/css_WEB-ITnose

: Conversion of Chinese character encoding in web pages_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:59
Original
1147 people have browsed it

There is an input form on the HTML page encoded as UTF8. After inputting Chinese characters, can the current page be directly converted to GBK and then passed to another GBK page? The action file cannot be modified, and the input page can only be UTF8 encoded.


Reply to discussion (solution)

http://bbs.csdn.net/topics/290070559 Make good use of the search function, you can also go directly to Baidu

1. No matter what the page encoding is, the browser internally processes Unicode
2. I don’t understand the meaning of passing it to another GBK page

For example: URL 1 Input form (UTF8 encoding)




If you want to enter it, directly convert the keyword to GBK on URL 1 and then execute act.jsp on URL 2

function foo() {  document.charset = 'gbk';}
Copy after login
<form  name=form1 method="post"  action="网址二/act.jsp "  onsubmit=foo()>  <input type="txt" name="keyword" value=""></form>
Copy after login


Just set the character set before submitting

This method doesn’t work.

Change the action file encoding?

The action file cannot be changed because it is made by the developer

Problem solved, thank you! ! ! !

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template