mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 19:01:13 +02:00
lcd4l: try to fix encoding mess
Origin commit data
------------------
Branch: ni/coolstream
Commit: bdbd8b5592
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-09-26 (Mon, 26 Sep 2016)
Origin message was:
------------------
- lcd4l: try to fix encoding mess
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -792,13 +792,13 @@ bool CLCD4l::WriteFile(const char *file, std::string content, bool convert)
|
|||||||
|
|
||||||
if (convert) // align to internal lcd4linux font
|
if (convert) // align to internal lcd4linux font
|
||||||
{
|
{
|
||||||
strReplace(content, "ä", "<EFBFBD>");
|
strReplace(content, "ä", "\xe1\0");
|
||||||
strReplace(content, "ö", "<EFBFBD>");
|
strReplace(content, "ö", "\xef\0");
|
||||||
strReplace(content, "ü", "<EFBFBD>");
|
strReplace(content, "ü", "\xf5\0");
|
||||||
strReplace(content, "Ä", "Ae");
|
strReplace(content, "Ä", "\xc4\0");
|
||||||
strReplace(content, "Ö", "Oe");
|
strReplace(content, "Ö", "\xd6\0");
|
||||||
strReplace(content, "Ü", "Ue");
|
strReplace(content, "Ü", "\xdc\0");
|
||||||
strReplace(content, "ß", "<EFBFBD>");
|
strReplace(content, "ß", "\xe2\0");
|
||||||
strReplace(content, "é", "e");
|
strReplace(content, "é", "e");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,17 +853,13 @@ bool CLCD4l::CompareParseID(uint64_t &i_ParseID)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// stolen from gui/movieinfo.cpp
|
void CLCD4l::strReplace(std::string &orig, const std::string &fstr, const std::string &rstr)
|
||||||
void CLCD4l::strReplace(std::string & orig, const char *fstr, const std::string rstr)
|
|
||||||
{
|
{
|
||||||
unsigned int index = 0;
|
size_t pos = 0;
|
||||||
unsigned int fstrlen = strlen(fstr);
|
while ((pos = orig.find(fstr, pos)) != std::string::npos)
|
||||||
int rstrlen = rstr.size();
|
|
||||||
|
|
||||||
while ((index = orig.find(fstr, index)) != std::string::npos)
|
|
||||||
{
|
{
|
||||||
orig.replace(index, fstrlen, rstr);
|
orig.replace(pos, fstr.length(), rstr);
|
||||||
index += rstrlen;
|
pos += rstr.length();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ class CLCD4l
|
|||||||
bool GetLogoName(uint64_t channel_id, std::string channel_name, std::string & logo);
|
bool GetLogoName(uint64_t channel_id, std::string channel_name, std::string & logo);
|
||||||
|
|
||||||
std::string hexStr(unsigned char* data);
|
std::string hexStr(unsigned char* data);
|
||||||
void strReplace(std::string & orig, const char *fstr, const std::string rstr);
|
void strReplace(std::string &orig, const std::string &fstr, const std::string &rstr);
|
||||||
bool WriteFile(const char *file, std::string content = "", bool convert = false);
|
bool WriteFile(const char *file, std::string content = "", bool convert = false);
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
Reference in New Issue
Block a user