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
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;
Absolute legend, tried encoding the wstring to a multibyte char* and now it's displaying perfectly!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:
Like this I didnt find a char that cant be displayed as overlay-text. Hope that helps.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;
Return to “Development around libVLC”
Users browsing this forum: No registered users and 13 guests