Unicode character conversation

A

Antimon

Hi,

I need to convert a unicode string to ASCII. I can simply use getbytes
method to do that but i would use some characters since Unicode is
16bit.
But i thought there might be some way to convert characters like "ü"
to "u" or, "å" to "a".
Or a chance i can find a conversation table?

Thanks.
 
T

the.duckman

Actuly,

I'd be interested to know if anybody can solve this problem using a
single regular expression.

-dm
 
S

Stephany Young

ASCII is limited to 7 bits being bytes vales 0 to 127 inclusive.

If none of your Unicode characters have a value greater than 255 then you
can use ANSI or UTF8.

If any of your Unicode characters have a value greater than 255 then you are
stuck with using Unicode.


Hi,

I need to convert a unicode string to ASCII. I can simply use getbytes
method to do that but i would use some characters since Unicode is
16bit.
But i thought there might be some way to convert characters like "ü"
to "u" or, "å" to "a".
Or a chance i can find a conversation table?

Thanks.
 
J

Jon Skeet [C# MVP]

Stephany Young said:
ASCII is limited to 7 bits being bytes vales 0 to 127 inclusive.
Yes.

If none of your Unicode characters have a value greater than 255 then you
can use ANSI or UTF8.

If any of your Unicode characters have a value greater than 255 then you are
stuck with using Unicode.

No, not really. For one thing, the various ANSI encodings don't just
map 0-255 to Unicode 0-255 - it's quite possible to have a string which
includes Unicode characters > 255 but which can still be correctly
encoded in a particular ANSI encoding.

Furthermore, UTF-8 can cope with *all* Unicode characters. Non-ASCII
characters are encoded to more than one byte, but they're still encoded
properly...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top