Home All Groups Group Topic Archive Search About

Decoding extended ascii base64 string

Author
30 Mar 2005 2:39 PM
Mandy
Hi,
I have an application that sends a .NET (C#) web service an base64 encoded
string.  This string sometimes includes extended ascii, e.g. é ù ô and when I
try to decode this string in the webservice using:
string decodedString = Encoding.UTF8.GetString( Convert.FromBase64String(
base64String) );

(string decodes fine if only a-z, A-Z in original string)

All the extended ASCII letters are missing, and if I just try to do:
Convert.FromBase64String( base64String);
The service throws an invalid character error.

When I try to decode the string via online decoders, the string decodes fine
with all characters so I'm pretty sure the encoded string is correct.

Does anyone have any ideas on how I can get the whole decoded string? Any
help would be most appreciated!

Cheers,
Mandy

Author
30 Mar 2005 3:21 PM
Nicole Calinoiu
How is the string encoded in the client application?  If UTF-8 isn't working
for decoding, it's likely that some other format is being used for the
original encoding.  You'll need to know what the format is before you can
decode properly.



Show quoteHide quote
"Mandy" <Ma***@discussions.microsoft.com> wrote in message
news:41151599-F68E-40D5-9B8C-D66EA038DC6A@microsoft.com...
> Hi,
> I have an application that sends a .NET (C#) web service an base64 encoded
> string.  This string sometimes includes extended ascii, e.g. é ù ô and
> when I
> try to decode this string in the webservice using:
> string decodedString = Encoding.UTF8.GetString( Convert.FromBase64String(
> base64String) );
>
> (string decodes fine if only a-z, A-Z in original string)
>
> All the extended ASCII letters are missing, and if I just try to do:
> Convert.FromBase64String( base64String);
> The service throws an invalid character error.
>
> When I try to decode the string via online decoders, the string decodes
> fine
> with all characters so I'm pretty sure the encoded string is correct.
>
> Does anyone have any ideas on how I can get the whole decoded string? Any
> help would be most appreciated!
>
> Cheers,
> Mandy
>