Cyrillic letters are incorrectly encoded in the C# Web Service [duplicate]

冷暖自知 提交于 2019-12-25 05:10:15

问题


Possible Duplicate:
Parsing UTF8 encoded data from a Web Service

I've written small web service which inserts data to the DB.

It takes parameter "comment":

CreateBuy(DateTime date, String cardNumber, Decimal amount, String comment) 
{
    ...
}

It works fine with latin letters, but when I try to pass value of comment = "Продукт1" it passes to the stored procedure value @comment = '?YN€????N???N‚1' instead of 'Продукт1'.

How can it be resolved?


回答1:


Use localization parameters for this string. To avoid such problems, working both with english and russian better use Utf-8 encoding.



来源:https://stackoverflow.com/questions/10562166/cyrillic-letters-are-incorrectly-encoded-in-the-c-sharp-web-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!