Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASCII code problems
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
ASCII code problems
Divers
Thread ID:
00672238
Message ID:
00672238
Vues:
33
I'm having a problem with some ascii codes here and I can't figure it out. It would be great if someone could help me. Anyway, in VFP:
?chr( asc(chr(149))
displays some weird symbol, but a symbol I need.

the problem is with the chr(149). Of course, I'm not actually using
'chr(149)', but the appropriate character. Just doing it this way for display purposes here.
Now, if I had a string that began with chr(149), in c#:
int nAscVal = (int)Char.Parse( cString.Substring( 0, 1 ) )
nAscVal now has a value of 8226, it should be 149.

It must have something to do with the encoding, but I don't know what. I've tried some stuff, like:
int pintAsc = (new ASCIIEncoding()).GetBytes(new char[]{Char.Parse( cString.Substring( 0, 1 ))})[0];
but no matter what character I select with the substring, it always returns a value of 63 to pintAsc. I'm lost on this one, anyone got any clues? Thanks,
jfh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform