|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.teldap.core.xmlvalidator.util.encoding.ValidCharacter
public class ValidCharacter
Copyright 2009 數位典藏與數位學習國家型科技計畫(TELDAP) 數位核心平台計畫
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Title: 檢查檔案是否有亂碼,以及是否有合理使用字元參引
Field Summary | |
---|---|
static java.util.ArrayList |
alCorrectCode
|
Constructor Summary | |
---|---|
ValidCharacter()
|
Method Summary | |
---|---|
java.util.HashMap |
collectMsg(java.io.File des)
|
java.lang.StringBuffer |
getStringBuffer(java.io.File file)
|
boolean |
hasUnknownWords(java.io.File file)
是否有亂碼:依據我們過去經手處理過的XML檔案,各個機構單位將資料從資料庫轉出成XML時,由於編碼的問題未妥善處理,經常在我方接收的檔案裡會出現亂碼,這種編碼問題並非是採用非指定的編碼方式,而是經過錯誤轉換後的字元用Big5編碼儲存了起來。 |
boolean |
isWordReferenceValid(java.io.File file)
字元參引(NCR 或 Entity Reference)是否符合格式:字元參引會使用在兩個時機,使用時機之一是當字元無法用Big5編碼時,譬如使用外來語,像是日文或韓文,此時則必須用數字字元參引(NCR=Numeric Character Reference)來表示該字元。 |
void |
loadBig5Code()
載入中文字UTF-8,Big5碼對照表 |
boolean |
validateEntityReference(java.io.File file)
字元參引是否合理使用:因為每個中文字皆有可表示的字元參引,在疏忽的情況下偶會出現整個檔案的文字都用字元參引表示,為了能夠檢測出這樣的檔案,防止連一般的中文字都用字元參引表示,檔案內出現的字元參引都必須經由比對一份字元編碼表(中文字UTF- 8,Big5碼對照表),以確定檔案內的字元參引的確是表示Big5缺漏的中文字。 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.ArrayList alCorrectCode
Constructor Detail |
---|
public ValidCharacter()
Method Detail |
---|
public void loadBig5Code()
public java.lang.StringBuffer getStringBuffer(java.io.File file)
public boolean hasUnknownWords(java.io.File file)
file
- File XML檔案
public boolean isWordReferenceValid(java.io.File file)
file
- File XML檔案
public boolean validateEntityReference(java.io.File file)
file
- File XML檔案
public java.util.HashMap collectMsg(java.io.File des)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |