Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

View Poll Results: How was that ?
Good 1 25.00%
Nice 0 0%
Ummm, not bad 2 50.00%
boro binim baba delet khoshe 1 25.00%
Voters: 4. You may not vote on this poll

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Sep 25th, 2005, 1:04 PM   #1
sma_soft
Newbie
 
Join Date: Sep 2005
Location: Iran
Posts: 2
Rep Power: 0 sma_soft is on a distinguished road
Send a message via MSN to sma_soft Send a message via Yahoo to sma_soft
Convert a string to unicode string

Hi dudes,
I want to convert a string variable to its Unicode equivalent.
I know that I should use the MultiByteToWideChar function to do that. But I get the same result. Here is an example of that:

function ToUnicodeString(s:string):string;
var p1Char;
pw1:array[0..1024]of WideChar;
nLen1,nLen2:integer;
begin
p1:=PChar(s);
nLen1:=Length(s);
nLen2:=nLen1 * 2;
MultiByteToWideChar(CP_ACP , MB_COMPOSITE , p1 , nLen2 , @pw1 , nLen2);
Result:=WideString(pw1);
end;


Is there anything wrong in the code above ?
Thanks for help from anyone.
sma_soft is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC