Jdbc Informix Dynamic Server 11.70版符号商标转换为问号
rhel 2.6上的IBM Informix动态服务器版本11.70Jdbc Informix Dynamic Server 11.70版符号商标转换为问号,jdbc,unicode,informix,Jdbc,Unicode,Informix,rhel 2.6上的IBM Informix动态服务器版本11.70 一些信息 select distinct dbs_collate from sysmaster:sysdbslocale; dbs_collate ----------- en_US.819 我的jdbc jdbc.ep.ifx.url=jdbc:informix-sqli://server:9999/testdb:informixserver=test_shm;IFX_USE_STRENC=true; 桌子 c
select distinct dbs_collate
from sysmaster:sysdbslocale;
dbs_collate
-----------
en_US.819
jdbc.ep.ifx.url=jdbc:informix-sqli://server:9999/testdb:informixserver=test_shm;IFX_USE_STRENC=true;
create table test
(
id serial,
notes nchar(5120)
);
- 使用基于web的应用程序通过JDBC向Informix表添加文本
- 文本可以是任何东西,包括符号(如版权、商标)
- 我可以在表格中添加任何文字和符号
- 但某些符号如商标将另存为“?”
- 如何使符号正确保存和显示,而不是转换为“”
有些字符在
en_US.819
中没有表示。您可以看到它的外观:有版权
和保留
字符,而我看不到商标
我制作了一个简单的Jython程序,将这些字符插入Informix数据库。我的测试数据库使用波兰语编码pl_pl.1250
insert into test_nchar (id, notes) values (1, 'copyright: ©')
insert into test_nchar (id, notes) values (2, 'registered: ®')
insert into test_nchar (id, notes) values (3, 'trademark: ™')
Something is terrible wrong with [insert into test_nchar (id, notes) values (3, 'trademark: ™')]
Traceback (most recent call last):
File "jdbc_ifx_encoding.py", line 20, in run_sql
c.execute(sql)
SQLException: java.sql.SQLException: B\u0142\u0105d konwersji kod\xf3w wskutek zabronionej sekwencji lub b\u0142\u0119dnej warto\u015bci.
SELECT ...
1: [copyright: ©]
2: [registered: ®]
我尝试将错误消息从波兰语翻译为英语:代码转换时出错,因为不允许的序列或错误的值。
如果为插入带有商标字符的
,则此消息。商标既不适用于波兰CP1250,也不适用于您使用的CP819。也许您使用其他技术(如ODBC)插入了它
您还可以看到,select在版权/注册字符之前显示奇怪字符
我认为唯一的解决方案是使用Unicode编码(如UTF-8)创建新的数据库