473,626 Members | 3,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 constructedStri ng = encoding.GetStr ing(encryptedDa ta);

And I print constructedStri ng 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 3604
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.co m

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

UnicodeEncoding encoding = new UnicodeEncoding ( );
string constructedStri ng = encoding.GetStr ing(encryptedDa ta);

And I print constructedStri ng 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*********@gm ail.com> wrote:
I am trying to display the encrypted value on the console. When I use
the following

UnicodeEncoding encoding = new UnicodeEncoding ( );
string constructedStri ng = encoding.GetStr ing(encryptedDa ta);
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.To String(byte[])

--
Jon Skeet - <sk***@pobox.co m>
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
5263
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, etc.) What I'd like is something as simple as: CREATE TABLE junk (junklet VARCHAR(2500) CHARACTER SET UTF8)); import MySQLdb, re,urllib
3
7760
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 DB and display it onscreen. No matter which way I open the file, convert it to Unicode/leave it as is or what ever, I see all single bytes ok, but double bytes become 2 seperate single bytes. Surely there is an easy way to convert these mixed...
15
4307
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 or add line numbering to large Unicode file (1 million lines). I don't want to deal with another programming language if possible and I wonder if there's a trick in SQL Server to get this accomplished. Thanks for any help. Mark Leary
4
6058
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 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
10
8045
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
18
34111
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 Encoding.Convert, but that needs byte arrays. Thanks, /Ger
6
6606
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 performance loss using (multibyte) UNICODE vs (single byte) SQL_ASCII/LATINxxx character encoding? (In terms of extra data, and searching/sorting speeds).
10
1413
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 nice little diamond. Infact, you can do this all the way up to 127 showing different characters including those similar with the ASCII table for letters and numbers. "Oh," I thought, "this could be the simple way for very simple encoding of...
8
2255
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 that can be used for unicode support in python? Incase of decimal numbers, how to handle "comma as a decimal point"
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.