[Lazarus] DLL unicode value
Balazs Szekely
balazsszekely at yahoo.com
Fri May 22 18:14:57 CEST 2015
Hi Ara,
Try this:uses lazutf8;var us: unicodestring;//alternatively you can use widestring
begin //... us := MediaInfo_Get(HND, Stream_General, 0, 'Title', Info_Text, Info_Name); ListBox.Items.Add(UTF16ToUTF8(us);
end;
From: aradeonas <aradeonas at operamail.com>
To: lazarus at lists.lazarus.freepascal.org
Sent: Friday, May 22, 2015 6:34 PM
Subject: [Lazarus] DLL unicode value
Hi,
I want to get unicode value from an mp3 file and I used MediaInfo library for this and its unicode support and I used unicode methods.
Code is simple :
MediaInfoDLL_Load('MediaInfo.dll');
HND := MediaInfo_New();
MediaInfo_Open(HND, 'test.mp3');
ListBox.Items.Add(MediaInfo_Get(HND, Stream_General, 0, 'Title', Info_Text, Info_Name));
//MediaInfo_Get: function (Handle: Cardinal; StreamKind: TMIStreamKind; StreamNumber: Integer; Parameter: PWideChar; KindOfInfo: TMIInfo; KindOfSearch: TMIInfo): PWideChar cdecl stdcall;
It work if Title value is ansi but if it is unicode it returns "???????" !
But if I debug andset value to an string it's deug it shows me correct value.
s:=MediaInfo_Get(HND, Stream_General, 0, 'Title', Info_Text, Info_Name);//in debug s hint shows correct value but ListBox add ???
ListBox.Items.Add(s);
Regards,
Ara
--
http://www.fastmail.com - Access your email from home and the web
--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150522/f933ac7f/attachment-0003.html>
More information about the Lazarus
mailing list