Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-05

DLL unicode value

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

aradeonas

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 :

Show quoted text 6 lines
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150522/706ddc22/attachment.html>

Reply by email

Balazs Szekely
to aradeonas

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
To:
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

Reply by email

Balazs Szekely
to aradeonas

Can you please attach a small project(MediaInfo.dll and test.mp3 included) so I can run a few tests?

From: aradeonas
To:
Sent: Friday, May 22, 2015 7:24 PM
Subject: Re: [Lazarus] DLL unicode value

?Thanks but it didnt work.It just now show ? instead of ???? but still debug hint of "us" is correct.

?Ara
??--
http://www.fastmail.com - Same, same, but different...

Reply by email

Balazs Szekely
to aradeonas

I'm glad it's working now. No, I don't have experience with MediaInfo, but I seen this Windows(UTF16) -->Lazarus(UTF8) conversion problem so many times that I thought I put my two cents in. regards,Balazs

From: aradeonas
To:
Sent: Friday, May 22, 2015 8:03 PM
Subject: Re: [Lazarus] DLL unicode value

I was preparing test files for you but I found a missed typing in my code else where that cause this problem ;)
Thank you very much.

Balazs do you have expediencies with MediaInfo?

Regards,
Ara

http://www.fastmail.com - Send your email first class --

Reply by email