Oracle10gR1引入了一个叫做Language and Character Set Detection (LCSD) 的新特性,可以快速高效的确定一个文件中的字符所适用的字符集。LCSD可以通过Oracle提供的GDK(Globalization Development Kit) java API接口调用。基于该特性,Oracle也提供了一个命令行工具LCSSCAN(Language and Character Set File Scanner)。从Oracle10gR2开始该工具还支持对HTML文件的扫描。
LCSSCAN的语法很简单,基本上一看就会使用:
D:\>lcsscan help
Language and Character Set File Scanner v2.1
(c) Copyright 2003, 2004 Oracle Corporation. All rights reserved.
You can control how LCSSCAN runs by entering the LCSSCAN command
followed by the required parameters. To specify parameters, you use
keywords:Example: LCSSCAN RESULTS=2 END=1000 FORMAT=HTML FILE=index.html
Keyword Description (Default)
——————————————————————–
RESULTS number of language and character set pairs to return (1)
BEGIN beginning byte offset of file (1)
END ending byte offset of file (end of file)
FORMAT file format TEXT, HTML or AUTO detect (TEXT)
FILE name of input file
HELP show help screen (this screen)
FILE就是要扫描的文件,BEGIN和END则指定只扫描文件的部分内容。RESULTS指明要返回几组可用的结果,因为一个文件可能兼容于多种字符集。FORMAT指明文件的类型。
D:\>lcsscan file=test.txt
Language and Character Set File Scanner v2.1
(c) Copyright 2003, 2004 Oracle Corporation. All rights reserved.
test.txt: SIMPLIFIED CHINESE ZHS16CGB231280;
这个你在Linux环境下使用过吗?
我在Linux的环境下使用了,是这么执行的,不好用,还需要设置什么吗?