Page 1 of 1

Marquee not display text went ° is in string

Posted: 18 Dec 2012 03:38
by chrisS
Is there a way to make sure that the marquee text is displaying went a "°" or ascii 176 is in the text?.
Thanks in advance

Re: Marquee not display text went ° is in string

Posted: 18 Dec 2012 10:23
by Jean-Baptiste Kempf
How does it display now?

Re: Marquee not display text went ° is in string

Posted: 18 Dec 2012 20:36
by chrisS
It does not display any text at all.

Re: Marquee not display text went ° is in string

Posted: 19 Dec 2012 12:20
by Jean-Baptiste Kempf
Look in the logs.

Re: Marquee not display text went ° is in string

Posted: 20 Dec 2012 09:30
by eli13
I guess:
- You use libVLC on Windows
- You have set the Character Encoding in the project properties to Unicode
- You use std::wstring for strings
- You "somehow" convert the wchar_t from the wstring to a char* that can be passed to the libvlc_marquee_XX functions

I had the same problem first, nothing gets displayed if non-asci chars were used. Solution: Encode the wstring properly to a MultiByte char* and pass that to libvlc, using the 'WideCharToMultiByte' function from windows. Specify UTF-8 as Codepage. Something like this:

Code: Select all

wstring text = L"ööääèè??°°°^^"; int len; int slength = (int)text.length() + 1; len = WideCharToMultiByte(CP_UTF8, 0, text.c_str(), slength, 0, 0, 0, 0); if(len == 0) { // error } char* multiByteChar = new char[len]; WideCharToMultiByte(CP_UTF8, 0, text.c_str(), slength, multiByteChar, len, 0, 0); if(len == 0) { delete[] multiByteChar; // error } return multiByteChar;
Like this I didnt find a char that cant be displayed as overlay-text. Hope that helps.

Re: Marquee not display text went ° is in string

Posted: 07 Jan 2013 03:35
by chrisS
Thank you, I will definely give this a try.
In another matter am using Power Basic with a few wrapper functions to make a app that using the vlc.dll
At the moment I'm having issues passing a arguement list to the libvlc_new(vlc_argc, VARPTR(temp(0)))) function, it cause my whole program to crash unless the vlc_agc is set to 0.
I try to get the log working but that means i have to get the arguerment list working also. Unless there a functions that allows me to set the log file and verbose level
Thanks in advance

Re: Marquee not display text went ° is in string

Posted: 05 Aug 2013 23:51
by CaptainBoc
I guess:
- You use libVLC on Windows
- You have set the Character Encoding in the project properties to Unicode
- You use std::wstring for strings
- You "somehow" convert the wchar_t from the wstring to a char* that can be passed to the libvlc_marquee_XX functions

I had the same problem first, nothing gets displayed if non-asci chars were used. Solution: Encode the wstring properly to a MultiByte char* and pass that to libvlc, using the 'WideCharToMultiByte' function from windows. Specify UTF-8 as Codepage. Something like this:

Code: Select all

wstring text = L"ööääèè??°°°^^"; int len; int slength = (int)text.length() + 1; len = WideCharToMultiByte(CP_UTF8, 0, text.c_str(), slength, 0, 0, 0, 0); if(len == 0) { // error } char* multiByteChar = new char[len]; WideCharToMultiByte(CP_UTF8, 0, text.c_str(), slength, multiByteChar, len, 0, 0); if(len == 0) { delete[] multiByteChar; // error } return multiByteChar;
Like this I didnt find a char that cant be displayed as overlay-text. Hope that helps.
Absolute legend, tried encoding the wstring to a multibyte char* and now it's displaying perfectly! :)
Thanks man! :)