fix translit load
This commit is contained in:
@@ -101,22 +101,28 @@ TitleSubst::TitleSubst(const CString §ion)
|
|||||||
|
|
||||||
void TitleSubst::Load(const CString &filename, const CString §ion)
|
void TitleSubst::Load(const CString &filename, const CString §ion)
|
||||||
{
|
{
|
||||||
RageFile f(filename);
|
RageFile f;
|
||||||
|
if( !f.Open(filename) )
|
||||||
if (!f.IsOpen() || f.GetError() != 0)
|
{
|
||||||
|
LOG->Trace("Error opening %s: %s", filename.c_str(), f.GetError().c_str() );
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CString CurrentSection;
|
CString CurrentSection;
|
||||||
TitleTrans tr;
|
TitleTrans tr;
|
||||||
|
|
||||||
while (!f.AtEOF())
|
while (!f.AtEOF())
|
||||||
{
|
{
|
||||||
CString line = f.GetLine();
|
CString line;
|
||||||
if (f.GetError() != 0)
|
int ret = f.GetLine( line );
|
||||||
|
if( ret == 0 )
|
||||||
|
break;
|
||||||
|
if( ret == -1 )
|
||||||
{
|
{
|
||||||
f.ClearError();
|
LOG->Trace("Error reading %s: %s", filename.c_str(), f.GetError().c_str() );
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(line.size() > 0 && utf8_get_char(line.c_str()) == 0xFEFF)
|
if(line.size() > 0 && utf8_get_char(line.c_str()) == 0xFEFF)
|
||||||
{
|
{
|
||||||
/* Annoying header that Windows puts on UTF-8 plaintext
|
/* Annoying header that Windows puts on UTF-8 plaintext
|
||||||
|
|||||||
Reference in New Issue
Block a user