I am developing an application where i am receiving data in hex but i need to convert in to unicode format to show. if any one can help me.
Printable View
I am developing an application where i am receiving data in hex but i need to convert in to unicode format to show. if any one can help me.
Are you sure about this?
People seem to get wildly confused about binary data and its representations. Hex, Octal, Decimal, and even Binary strings like 11001011 are just symbolic representations. It seems very unlikely anyone would send you data "in hex" since it would be fairly wasteful and pointless. You probably mean you are receiving a stream of bytes.
As far as "converting" this to "Unicode format" we're left scratching our heads some more.
Most likely the data already is arriving as Unicode. Then the question becomes "Which encoding?" UTF-8, UTF-16LE, and UTF16BE are in fairly common use though even others exist such as UTF-7.
Then once you have that unraveled you need to consider that most VB6 controls are ANSI and not Unicode controls. So that means either dealing with the conversions (and hopefully the implicit conversions work for the character set you need to display), limiting yourself to the few VB6 Unicode controls, or obtaining or creating Unicode controls that you need.
So as you can see you give us more empty blanks than filled ones in your question. At best we can only take random guesses about what you actually mean.
Agreed sending data in hex would be a waste of resources requiring 2 bytes for every byte. Most likely it is just a stream of bytes being sent/received
While it isn't impossible somebody might send 2 ANSI hex digits (or even 2 UTF-16 hex digits = 4 bytes for 1) it seems unlikely.
The way the question was stated the problem could be almost anything though. For all we know the data is being "received" as email attachments or morse code sent by flashlights.