![]() |
|
| 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 |
|
|
#1 |
|
Newbie
|
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 p1 Char;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. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
And the point of the poll is what?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2005
Location: Moseley, Birmingham, England, Earth
Posts: 51
Rep Power: 3
![]() |
var
A: String B: WideString begin A := 'This is the string to convert.'; B := A; end; |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
First time here that I see a such poll....
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|