国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Struts 的漢字顯示問題終結解決方案

2019-11-18 15:54:54
字體:
來源:轉載
供稿:網友

  看了網上的很多的解決方法,似乎都很好,但實際的操作中還是發現了很多的問題. 試了很久才找到最終的解決方案.
  
  1. 主要是屬性文件的字符轉換問題.具體步驟和檢測如下:
  
  1) 用一般的編輯器輸入所要顯示的漢字
  
  2) 使用java JDK 下的native2ascii. 具體說明見
  
  http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.Html
  
  native2ascii - Native-to-ASCII Converter
  Converts a file with native-encoded characters (characters which are non-Latin 1 and non-Unicode) to one with Unicode-encoded characters.
  SYNOPSIS
  native2ascii [options] [inputfile [outputfile]]
  
  DESCRipTION
  The Java compiler and other Java tools can only PRocess files which contain Latin-1 and/or Unicode-encoded (/udddd notation) characters. native2ascii converts files which contain other character encodings into files containing Latin-1 and/or Unicode-encoded charaters.
  If outputfile is omitted, standard output is used for output. If, in addition, inputfile is omitted, standard input is used for input.
  
  OPTIONS
  -reverse
  Perform the reverse Operation: convert a file with Latin-1 and/or Unicode encoded characters to one with native-encoded characters.
  
  -encoding encoding_name
  Specify the encoding name which is used by the conversion procedure. The default encoding is taken from System property file.encoding. The encoding_name string must be taken from the first column of the table of supported encodings in the Supported Encodings document.
  
  -Joption
  Pass option to the Java virtual machine, where option is one of the options described on the reference page for the java application launcher. For example, -J-Xms48m sets the startup memory to 48 megabytes.
  
  For encoding name you can reference:
  
  http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html
  
  For chinese use normally use: GBK, Big5. In Sun's encoding document, it is mentioned this conversion need: lib/rt.jar or lib/charsets.jar. These two file only can file Sun's JRE package. They cant find in Sun's JDK package.
  
  但是我在轉換的時候沒有這兩個文件似乎也沒有問題.
  
  Example: native2ascii -encoding GBK Inputfilename outputfilename
  
  轉換后的校驗.
  
  native2ascii 會因為你的系統不同,可能會有不同的轉換結果. 假如發現問題,你可以去:
  
  http://www.unicode.org/charts/ 查詢,依據目前的版本,你可以找到
  
  East Asian Scripts-> Han ideographs->Unified CJK ideographs(5M)
  
  http://www.unicode.org/charts/PDF/U4E00.pdf 這個文件.
  
  下載后,你用PDF reader 的search功能找到你要轉換的漢字,比較轉換后的
  
  字符是否正確,比如:我,在轉換后為 /u6211.
  
  所有的jsp文件采用UTF-8格式遍寫.并在文件頭強制:
  
  <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  
  這樣你的問題就解決了.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 荃湾区| 万宁市| 苗栗市| 米脂县| 五台县| 呼图壁县| 湘乡市| 彭州市| 清苑县| 蒙山县| 伽师县| 新沂市| 介休市| 屯留县| 安达市| 孟津县| 罗定市| 昭平县| 广宁县| 淮南市| 三都| 明溪县| 两当县| 嘉禾县| 巴东县| 九江县| 赤峰市| 朝阳县| 恩平市| 个旧市| 紫阳县| 尚义县| 鞍山市| 吴川市| 郁南县| 金山区| 巴里| 虹口区| 清水县| 金乡县| 海城市|