ASCII encryption

M

Mike P

I'm trying to encrypt a string into ASCII, and it seems to encrypt fine,
but when I write it to my SQL Server database all the ASCII chars
between 128-159 and 191-255 are replaced with the ? symbol. I know that
ASCII values 128-159 aren't supported by Windows and 191-255 are
non-English characters, but I've never had a problem with these
characters before when encrypting stuff in VB6.

Can anybody help me out with this?


Cheers,

Mike
 
J

Jon Skeet

Mike P said:
I'm trying to encrypt a string into ASCII, and it seems to encrypt fine,
but when I write it to my SQL Server database all the ASCII chars
between 128-159 and 191-255 are replaced with the ? symbol. I know that
ASCII values 128-159 aren't supported by Windows and 191-255 are
non-English characters, but I've never had a problem with these
characters before when encrypting stuff in VB6.

There *are* no ASCII characters above 127.

See http://www.pobox.com/~skeet/csharp/unicode.html
 
J

Jon Skeet

Mike P said:
I thought ASCII goes from 0-127 and the extended character set from
128-255?

No. There are various things which people call "the extended [ASCII]
character set" - which means that when one person says they're using
it, no-one really knows which they mean. It's basically a term which
should be avoided if you have any interest in actually conveying useful
and unambiguous information about the encoding you're using.

Specifying the Windows code page (eg 437, 850 etc) on the other hand,
is more useful. Specifying a standardised character encoding (eg ISO-
8859-1, UTF-8 etc) is even better.
 

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