Unicode到ASCII字符串转换 [英] Unicode to ASCII string conversion

查看:63
本文介绍了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.org/>

VB< URL:http://dotnet.mvps.org/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:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Ger,

除了Herfried的评论。


有关Unicode,ASCII和.NET编码的信息,请参阅:< > http:/ /www.yoda.arachsys.com/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:

http://www.yoda.arachsys.com/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.com> schreef in bericht

新闻:ee ************** @ TK2MSFTNGP11.phx.gbl ...
Thanks Jay, a most useful document.
/Ger

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schreef in bericht
news:ee**************@TK2MSFTNGP11.phx.gbl...
Ger,除了Herfried的评论之外。

有关Unicode,ASCII和.NET编码的信息,请参阅:

http://www.yoda.arachsys.com/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:

http://www.yoda.arachsys.com/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字符串转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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