473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Unicode Encoding / Encryption RSA

Hi,
I am trying to display the encrypted value on the console. When I use
the following

UnicodeEncoding encoding = new UnicodeEncoding( );
string constructedString = encoding.GetString(encryptedData);

And I print constructedString on to the console, I see "??????" When I
do a debug, I see boxes. But if I put a watch on the variable (on the
encrypteddata), see the hex values.

What I want to do is display the hex value on the screen.

Any help would be greatly appreciated.
Thanks,
Shahid

Nov 17 '05 #1
3 3577
Shahid,

Is it possible that the font that is being used for the console doesn't
support unicode characters (it might only support ascii characters, which is
why you are getting the ?????).

I would change the font on the console to one that can support these
characters.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Shahid" <sh*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi,
I am trying to display the encrypted value on the console. When I use
the following

UnicodeEncoding encoding = new UnicodeEncoding( );
string constructedString = encoding.GetString(encryptedData);

And I print constructedString on to the console, I see "??????" When I
do a debug, I see boxes. But if I put a watch on the variable (on the
encrypteddata), see the hex values.

What I want to do is display the hex value on the screen.

Any help would be greatly appreciated.
Thanks,
Shahid

Nov 17 '05 #2
Shahid <sh*********@gmail.com> wrote:
I am trying to display the encrypted value on the console. When I use
the following

UnicodeEncoding encoding = new UnicodeEncoding( );
string constructedString = encoding.GetString(encryptedData);
That's a bad idea. That's treating opaque binary data as if it were
encoded text.
What I want to do is display the hex value on the screen.


Use BitConverter.ToString(byte[])

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #3
Thanks! That worked perfectly!

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
15
by: | last post by:
The data file is a simple Unicode file with lines of text. BCP apparently doesn't guarantee this ordering, and neither does the import tool. I want to be able to load the data either sequentially...
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
6
by: John Sidney-Woollett | last post by:
Hi I need to store accented characters in a postgres (7.4) database, and access the data (mostly) using the postgres JDBC driver (from a web app). Does anyone know if: 1) Is there a...
10
by: RobKinney1 | last post by:
Hello everyone... This may sound really stupid, but it is something I have been working on all day and haven't found a solution yet. If you go into Notepad and try the keystroke ALT+4, you get a...
8
by: sonald | last post by:
Hi, I am using python2.4.1 I need to pass russian text into python and validate the same. Can u plz guide me on how to make my existing code support the russian text. Is there any module...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.