471,627 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

ascii encoding

Hi,

I want to convert byte array to a string using ascii encoding. I use
asciiEncoding.GetChars (asciiEncoding is ascii encoding instance).

I want symbols greater than 127 to be represented with '.' symbol (not
with '?') or another.

How could I do this?

Thanks.

Dec 11 '05 #1
1 1832
I want symbols greater than 127 to be represented with '.' symbol (not
with '?') or another.

How could I do this?


Loop through the byte array and replace any value > 127 with (byte)'.'
before using the Encoding class.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Dec 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by DraguVaso | last post: by
4 posts views Thread by webdev | last post: by
6 posts views Thread by Friso Wiskerke | last post: by
5 posts views Thread by tushar.saxena | last post: by
9 posts views Thread by =?Utf-8?B?RGFu?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.