Unicode到ASCII字符串转换

编程入门 行业动态 更新时间:2024-10-28 00:21:44
本文介绍了Unicode到ASCII字符串转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法在VB.Net中找到一个简单,直接的Unicode到ASCII 字符串转换函数。 这是因为这样的函数没有存在还是忽略它? 我找到了Encoding.Convert,但是需要字节数组。 谢谢, / Ger

I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found Encoding.Convert, but that needs byte arrays. Thanks, /Ger

推荐答案

*" Ger" < GE ********* @ remove-this-part-of-address.planet.nl> scripsit: * "Ger" <ge*********@remove-this-part-of-address.planet.nl> scripsit: 我无法在VB.Net中找到一个简单,直接的Unicode到ASCII 字符串转换函数。是因为这样的函数不存在或者我忽略了它? I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it?

''System.Text.Encoding.ASCII.GetBytes'', ''System.Text。 Encoding.Unicode.GetByte''。 BTW:注意在Unicode和 ASCII之间没有定义1:1映射,ASCII是7位只有,因此只能代表128个字符。 - MS Herfried K. Wagner MVP< URL:http ://dotnet.mvps/> VB< URL:http://dotnet.mvps/dotnet/faqs/>

''System.Text.Encoding.ASCII.GetBytes'', ''System.Text.Encoding.Unicode.GetByte''. BTW: Notice that there is no 1:1 mapping defined between Unicode and ASCII, ASCII is 7-bit only and can thus only represent 128 characters. -- M S Herfried K. Wagner M V P <URL:dotnet.mvps/> V B <URL:dotnet.mvps/dotnet/faqs/>

Ger, 除了Herfried的评论。 有关Unicode,ASCII和.NET编码的信息,请参阅: http:/ /www.yoda.arachsys/csharp/unicode.html 样本可能在C#中,但它们应该很容易转换为VB.NET 希望这有帮助 Jay " Ger" < GE ********* @ remove-this-part-of-address.planet.nl>在留言中写道 news:up ************** @ TK2MSFTNGP09.phx.gbl ... Ger, In addition to Herfried''s comments. For information on Unicode, ASCII and Encoding in .NET see: www.yoda.arachsys/csharp/unicode.html The samples may be in C#, however they should easily be converted to VB.NET Hope this helps Jay "Ger" <ge*********@remove-this-part-of-address.planet.nl> wrote in message news:up**************@TK2MSFTNGP09.phx.gbl... 我还没能在VB.Net中找到一个简单,直接的Unicode到ASCII 字符串转换函数。是因为这样的函数不存在还是我忽略了它? 我发现了Encoding.Convert,但需要字节数组。 谢谢, / Ger I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found Encoding.Convert, but that needs byte arrays. Thanks, /Ger

谢谢Jay,一个最有用的文件。 / Ger Jay B. Harlow [MVP - Outlook]" < JA ************ @ msn> schreef in bericht 新闻:ee ************** @ TK2MSFTNGP11.phx.gbl ... Thanks Jay, a most useful document. /Ger "Jay B. Harlow [MVP - Outlook]" <Ja************@msn> schreef in bericht news:ee**************@TK2MSFTNGP11.phx.gbl... Ger,除了Herfried的评论之外。 有关Unicode,ASCII和.NET编码的信息,请参阅: www.yoda.arachsys/csharp/unicode.html VB.NET 希望这有助于 Jay Ger < GE ********* @ remove-this-part-of-address.planet.nl>在消息中写道新闻:up ************** @ TK2MSFTNGP09.phx.gbl ... Ger, In addition to Herfried''s comments. For information on Unicode, ASCII and Encoding in .NET see: www.yoda.arachsys/csharp/unicode.html The samples may be in C#, however they should easily be converted to VB.NET Hope this helps Jay "Ger" <ge*********@remove-this-part-of-address.planet.nl> wrote in message news:up**************@TK2MSFTNGP09.phx.gbl... 我一直未能找到一个简单的,直接转发Unicode到ASCII VB.Net中的字符串转换函数。是因为这样的函数不存在还是我忽略了它? 我找到了Encoding.Convert ,但这需要字节数组。 谢谢, / Ger I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found Encoding.Convert, but that needs byte arrays. Thanks, /Ger

更多推荐

Unicode到ASCII字符串转换

本文发布于:2023-10-28 13:10:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   Unicode   ASCII

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!