字母Ñ编码时出错 [英] error when encoding the letter Ñ

查看:95
本文介绍了字母Ñ编码时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,亲爱的开发人员,我正在开发一个包含数据加密的C#项目,但是我遇到了西班牙语中使用的leterÑ的麻烦,您对此有什么解决方案吗?

请帮助我或与我联系.joe.metal@hotmail.com

Hello dear developers, I am working on a project C#, that contains data encryption, but I am having some trouble with the leter Ñ that is used in Spanish, do you have any solution for that?

please help me or contact me joe.metal@hotmail.com

推荐答案

没有解决方案,因为只要字体支持Unicode,就不会出现这种问题.确保在加密之前不要将文本转换为ANSI或任何其他非Unicode编码.最好将文本视为UTF-8,请参见 http://msdn.microsoft.com/en-us/library/system.text.utf8encoding.aspx [ http://en.wikipedia.org/wiki/UTF-8 [ http://unicode.org/ [ ^ ],
http://unicode.org/faq/utf_bom.html [
但是首先,请尝试自行解决.

—SA
There is not solution because there is no such problem, as soon as your font supports Unicode. Make sure you do not convert text into ANSI or any other non-Unicode encoding before encryption. It''s the best to treat the text as UTF-8, see http://msdn.microsoft.com/en-us/library/system.text.utf8encoding.aspx[^]. The encoding converts text from/to array of bytes which should be further encrypted/decrypted.

See also:
http://en.wikipedia.org/wiki/UTF-8[^],
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].

If you still cannot overcome this confusion, you may want to make a short code sample (really short, some 5 lines or so) to show what are you doing. I would be able to find out what''s wrong. Use "Improve question".

But first, please try to sort it out yourself.

—SA


这篇关于字母Ñ编码时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆