Git Product home page Git Product logo

Comments (8)

wuzhenda avatar wuzhenda commented on June 12, 2024

It's not Chinese language,it‘s gibberish.

from vlc.dotnet.

adrians75 avatar adrians75 commented on June 12, 2024

Thanks for the clarification :)
Then, how to get the correct Title, not gibberish?

from vlc.dotnet.

wuzhenda avatar wuzhenda commented on June 12, 2024

I think it's just the Character coding problem,why not try read the file name in your own code,try utf-8,unicode etc?

from vlc.dotnet.

adrians75 avatar adrians75 commented on June 12, 2024

Thanks again,
Is ok with files, but I need to play YouTube media or RTSP - online video. There this property, title, is very useful.

from vlc.dotnet.

JeanMeijer avatar JeanMeijer commented on June 12, 2024

Someone should go over the source code, to make sure all native text is converted to ANSI. That's the problem...

from vlc.dotnet.

JeanMeijer avatar JeanMeijer commented on June 12, 2024

Change line 16 in VlcManager.GetMediaMeta.cs (Core.Interops project) to this: return Marshal.PtrToStringAnsi(ptr);

from vlc.dotnet.

adrians75 avatar adrians75 commented on June 12, 2024

Thanks! Solve the problem. :)

from vlc.dotnet.

Mizutama avatar Mizutama commented on June 12, 2024

You never check with different languages :(
YouTube returns strings in UTF-8 therefore marshal must be done with utf-8 encoding.
There is no PtrToStringUTF8 so

//return Marshal.PtrToStringAnsi( ptr );
int len = 0;
while ( Marshal.ReadByte( ptr , len ) != 0 ) ++len;
byte[] buffer = new byte[len];
Marshal.Copy( ptr , buffer , 0 , buffer.Length );
return System.Text.Encoding.UTF8.GetString( buffer );

btw,
var media = myControl.MediaPlayer.GetCurrentMedia();
var utf8 = System.Text.Encoding.UTF8.GetString(System.Text.Encoding.Default.GetBytes(media.Title));
could not get correct string. Issue #178 has been solved?(>_<)

from vlc.dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.