简体   繁体   English

字符映射问题.NET-Informix

[英]Character mapping issue .NET-Informix

I'm having a very strange issue when I retrieve the data from the DB in the server gets misread. 当我从服务器中的数据库中检索数据时,我遇到了一个非常奇怪的问题。 The original message is: Avería resuelta Le comunicamos que la avería registrada en la dirección #DIRECCION# ha sido cerrada #FECHAHORAFIN#. 原始消息是: Avería resuelta Le comunicamos que la avería registrada en la dirección #DIRECCION# ha sido cerrada #FECHAHORAFIN#.

And the message we get on the server is this: Aver¡a resuelta Le comunicamos que la aver¡a registrada en la direcci¢n #DIRECCION# ha sido cerrada #FECHAHORAFIN#. 我们在服务器上收到的消息是: Aver¡a resuelta Le comunicamos que la aver¡a registrada en la direcci¢n #DIRECCION# ha sido cerrada #FECHAHORAFIN#.

We in the message we have special latin-1 characters, and we are specifiying in the connection string the charset as follows db_locale=es_es.cp1252; client_locale=es_es.cp1252 在消息中,我们具有特殊的latin-1字符,并且在连接字符串中指定了字符集,如下所示: db_locale=es_es.cp1252; client_locale=es_es.cp1252 db_locale=es_es.cp1252; client_locale=es_es.cp1252

And the strange thing is that when I execute the (console) application from mi local machine it gets executed just fine, but when I execute it from the server it doesn't recognize the characters good. 而且奇怪的是,当我从mi本地计算机执行(控制台)应用程序时,它执行得很好,但是当我从服务器执行该程序时,它不能识别出良好的字符。

The server is a Windows Server 2003 and my local machine is Windows 10. 该服务器是Windows Server 2003,本地计算机是Windows 10。

Thanks in advance. 提前致谢。

Edit: The value that this query, SELECT tabname, site FROM systables WHERE tabid IN ( 90, 91 ); 编辑:该查询, SELECT tabname, site FROM systables WHERE tabid IN ( 90, 91 ); is thowing, is the following: ,以下是:

tabname site GL_COLLATE es_ES.1252 GL_CTYPE es_ES.1252

解决方案是根据当前的文化背景来定位应用程序

System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM