<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AnySQL.net &#187; WE8ISO8859P1</title>
	<atom:link href="http://www.anysql.net/tag/we8iso8859p1/feed" rel="self" type="application/rss+xml" />
	<link>http://www.anysql.net</link>
	<description>SQLULDR2, DataCopy, DataSync, WebChart, OraMon, AUL/MyDUL, 性能优化及容量分析</description>
	<lastBuildDate>Wed, 14 Jul 2010 09:27:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WE8ISO8859P1字符集下,JDBC的中文支持问题</title>
		<link>http://www.anysql.net/developer/oracle_jdbc_we8iso8859p1.html</link>
		<comments>http://www.anysql.net/developer/oracle_jdbc_we8iso8859p1.html#comments</comments>
		<pubDate>Fri, 27 Apr 2007 05:28:19 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Charset]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[WE8ISO8859P1]]></category>

		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/we8iso8859p1%e5%ad%97%e7%ac%a6%e9%9b%86%e4%b8%8bjdbc%e7%9a%84%e4%b8%ad%e6%96%87%e6%94%af%e6%8c%81%e9%97%ae%e9%a2%98.html</guid>
		<description><![CDATA[&#160; &#160; 当数据库的字符集为US7ASCII, WE8DEC, WE8ISO8859P1及WE8MSWIN1252等单字节的字符集时, 使用JDBC时总发现不能准确地处理中文字符, 这个问题几年前就困扰着我, 一直也没有解决的办法. 以前遇到这些数据库的字符集时, 总是将$JAVA_HOME\lib目录下的charsets.jar移走来解决, 但是这样并不能解决CLOB中的中文字符问题. 昨天coolyl又问了这个同样的问题, 我在试验时发现JRE 1.6版本和JRE 1.4版本有所区别, 通过用-Dfile.encoding=ISO-8859-1的命令行选项, 在1.6下可以成功显示汉字, 而1.4下面同样的方法却不行. c:\jdk\sun160\bin\java -Dfile.encoding=ISO-8859-1 -jar jlib\oasql.jar c:\jdk\sun142\bin\java -Dfile.encoding=ISO-8859-1 -jar jlib\oasql.jar &#160; &#160; 使用1.6版本的JRE时, 情况如下: ASQL&#62; select * from nls_database_parameters &#160;&#160;&#160;&#160;2&#160;&#160;&#160;&#160;where parameter=&#8217;NLS_CHARACTERSET&#8217;; PARAMETER&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;VALUE &#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212; NLS_CHARACTERSET WE8ISO8859P1 1 rows returned. ASQL&#62; SELECT &#8216;中国&#8217; as COL1 FROM DUAL; COL1 &#8212;- 中国 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 当数据库的字符集为US7ASCII, WE8DEC, WE8ISO8859P1及WE8MSWIN1252等单字节的字符集时, 使用JDBC时总发现不能准确地处理中文字符, 这个问题几年前就困扰着我, 一直也没有解决的办法. 以前遇到这些数据库的字符集时, 总是将$JAVA_HOME\lib目录下的charsets.jar移走来解决, 但是这样并不能解决CLOB中的中文字符问题. 昨天coolyl又问了这个同样的问题, 我在试验时发现JRE 1.6版本和JRE 1.4版本有所区别, 通过用-Dfile.encoding=ISO-8859-1的命令行选项, 在1.6下可以成功显示汉字, 而1.4下面同样的方法却不行. </p>
<blockquote><p>
c:\jdk\sun160\bin\java -Dfile.encoding=ISO-8859-1 -jar jlib\oasql.jar <br />
c:\jdk\sun142\bin\java -Dfile.encoding=ISO-8859-1 -jar jlib\oasql.jar 
</p></blockquote>
<p>&nbsp; &nbsp; 使用1.6版本的JRE时, 情况如下: </p>
<blockquote class="prefont"><p>
ASQL&gt; select * from nls_database_parameters <br />
&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;where parameter=&#8217;NLS_CHARACTERSET&#8217;;</p>
<p>PARAMETER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;<br />
NLS_CHARACTERSET WE8ISO8859P1</p>
<p>1 rows returned.</p>
<p>ASQL&gt; SELECT &#8216;中国&#8217; as COL1 FROM DUAL;</p>
<p>COL1<br />
&#8212;-<br />
中国</p>
<p>1 rows returned.
</p></blockquote>
<p>&nbsp; &nbsp; 而使用1.4版本的JRE时, 情况如下: </p>
<blockquote class="prefont"><p>
ASQL&gt; SELECT &#8216;中国&#8217; as COL1 FROM DUAL;</p>
<p>COL1<br />
&#8212;-<br />
-?</p>
<p>1 rows returned.
</p></blockquote>
<p>&nbsp; &nbsp; 以上测试在Windows的Command窗口中测试, 机器的Locale为中国, 不知道其他的同行或Java的开发人员有什么好的建议? </p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2008/05/12 -- <a href="http://www.anysql.net/aulmydul/undo_and_index_bugs.html" title="Oracle不行再用AUL">Oracle不行再用AUL</a> (7)</li><li>2008/02/20 -- <a href="http://www.anysql.net/dba/export_charset_convert.html" title="导出时的字符集转换">导出时的字符集转换</a> (1)</li><li>2007/10/09 -- <a href="http://www.anysql.net/oracle/how_oracle_csscan_work.html" title="Oracle csscan工具的工作原理">Oracle csscan工具的工作原理</a> (0)</li><li>2007/10/08 -- <a href="http://www.anysql.net/oracle/oracle_charset_csscan.html" title="Oracle的字符集转换的一个小测试">Oracle的字符集转换的一个小测试</a> (1)</li><li>2007/07/10 -- <a href="http://www.anysql.net/tools/dmp2utf8_download_increase.html" title="dmp2utf8的下载量骤增, 不知什么原因?">dmp2utf8的下载量骤增, 不知什么原因?</a> (5)</li><li>2007/07/04 -- <a href="http://www.anysql.net/dba/update_sys_props_10g.html" title="为什么到二十一世纪还要改sys.props$呢?">为什么到二十一世纪还要改sys.props$呢?</a> (3)</li><li>2006/12/14 -- <a href="http://www.anysql.net/developer/jdbc_fetch_size.html" title="Array Fetch在Delay时间较长的网络中的重要性">Array Fetch在Delay时间较长的网络中的重要性</a> (2)</li><li>2006/12/11 -- <a href="http://www.anysql.net/tools/new_tool_dmp2utf8.html" title="更改dmp文件中的字符集 &#8212; dmp2utf8">更改dmp文件中的字符集 &#8212; dmp2utf8</a> (0)</li><li>2006/11/14 -- <a href="http://www.anysql.net/developer/data_direct_jdbc.html" title="优秀的DataDirect JDBC驱动">优秀的DataDirect JDBC驱动</a> (0)</li><li>2010/06/24 -- <a href="http://www.anysql.net/tools/sqluldr2-charset-option.html" title="控制SQLULDR2的字符集">控制SQLULDR2的字符集</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/developer/oracle_jdbc_we8iso8859p1.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
