Take care on the encoding of web server
2013-11-01 08:58
405 查看
后台验证表单中文长度时,由于本地开发环境使用UTF-8,一个汉字3个字节,使用string.getBytes().length发现 数量*3 。但测试环境使用 GBK
开发时,对于中文问题必须留意! 英文好办,大多编码都是一个字节。GBK来说,中文都是2个字节。到数据库oracle,使用varchar2也是存两字节一个汉字。
[root@xxxxx sysconfig]# cat i18n LANG="zh_CN.GBK" [root@xxxxx sysconfig]# echo $LANG zh_CN.GBK [root@xxxxx sysconfig]#
开发时,对于中文问题必须留意! 英文好办,大多编码都是一个字节。GBK来说,中文都是2个字节。到数据库oracle,使用varchar2也是存两字节一个汉字。
相关文章推荐
- Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
- IIS Error:404.2 The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server
- HTTP Error 404.2 - Not Found The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server(转)
- "无法启动Web服务器。Web服务器无法找到请求的资源" 或 "unable to start debugging on the web server.the web server could not find the request"解决方法
- arcgis server manager - An error has occured on the server. For details please check the Event (Application) log on the web.
- [原]Error while trying to run project: Unable to start debugging on the web server. 内存分配访问无效
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.
- some issues that you should be take care of when use the plupload module
- html2canvas- Take Screenshot of Web Page and Save It to Server (Javascript and PHP)
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in
- ISAPI and CGI Restriction list settings on the Web server
- Unable to start debugging on the web server
- Visual studio cannot create or open the application because the Web server on this computer is...
- 论文原稿:Research on the Status Quo and System architecture of the Web Information Resource Evaluation
- eclipse中tomcat的配置Configure the Web Modules on this server,auto reloading enabled
- IIS 7 The Web server is configured to not list the contents of this directory
- How To Turn Up Logging on the Siebel Web Server Extension in Siebel Versions 7.x and 8.x? [ID 477185
- HttpWebRequest WebExcepton: The remote server returned an error: (407) Proxy Authentication Required.
- Unable to start debugging on the web server. A debugger is alreddy attached.问题原因