Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Represent UCS2 string in my VB app?

Posted on 2003-03-29
3
Medium Priority
?
474 Views
Last Modified: 2010-05-01
Hi all,
I have a UCS2 encoded string "062C064506390629". How can I represent it as string in VB??
0
Comment
Question by:alkait
3 Comments
 
LVL 2

Accepted Solution

by:
stretch71 earned 120 total points
ID: 8235326
UCS2 is the same as UTF16 which is Unicode on Windows.

To do the conversion, you need to split the string into chunks of 4 characters and convert each into a unicode character.

Step 1.  Split the string into chunks, then in a loop...
Step 2.  Convert each hex chunk to a long
Step 3.  Use ChrW to get the unicode character
Step 4.  Put the character on the end of your result string.

For step 2, the code is very simple

dim l as long
l = clng("&H" & hexchunk)

The rest I will let you work out yourself, but it's very easy code.
0
 

Expert Comment

by:CleanupPing
ID: 8531333
Hi alkait,
This old question (QID 20567826) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9440666
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept stretch71's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question