Garbled solution

xiaoxiao2021-04-01  221

Today, I have encountered garbled problems, and now write the solution, it is used to prevent it!

1. Today's situation is this: from the data read from the database, some Chinese characters can be displayed normally, but some shows the question mark.

For example, Zhang Wei's words, Liu Wei's word, all shows the question mark, but Zhang and Liu show normal

The solution is as follows: <% @ Page ContentType = "text / html; charset = GB2312"%> change to GBK, because, 嫚

Already exceeding the range of character sets of GB2312

2. Other garbled solutions (this is enough to solve all garble questions)

<% @ Page ContentType = "text / html; charset = GB2312"%>

3. The following programs have not been used yet.

Username = new string (username.getbytes ("ISO-8859-1"), "GBK");

Request.SetCharacterencoding ("GBK")

4. If you want to be specific, you can refer to the BLOG of this person below.

Http://blog.9cbs.net/shaohua_505/

5. Today, I have encountered garbled problems, I haven't been encountered for a long time.

WINDOW.OPEN ("<% = contextPath%> / mlog / wellcheckdevreplist.do? Recordno = '" Recordnovalue "" " " " " "" "" "" " Width = 800px; height = 500px ');

Adopting the connector port = "8080" in Tomcat plus URIENCODING = "GB2312" Solution!

You can also use a filter for other garments!

转载请注明原文地址:https://www.9cbs.com/read-131186.html

New Post(0)