From e6daa6d2146f18e7febdbbeadf464d2898822d27 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 13 Dec 2003 11:45:26 +0000 Subject: [PATCH] fix translit load --- stepmania/src/TitleSubstitution.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/stepmania/src/TitleSubstitution.cpp b/stepmania/src/TitleSubstitution.cpp index 9d9f967220..8f4a2c28a4 100644 --- a/stepmania/src/TitleSubstitution.cpp +++ b/stepmania/src/TitleSubstitution.cpp @@ -101,22 +101,28 @@ TitleSubst::TitleSubst(const CString §ion) void TitleSubst::Load(const CString &filename, const CString §ion) { - RageFile f(filename); - - if (!f.IsOpen() || f.GetError() != 0) + RageFile f; + if( !f.Open(filename) ) + { + LOG->Trace("Error opening %s: %s", filename.c_str(), f.GetError().c_str() ); return; + } CString CurrentSection; TitleTrans tr; while (!f.AtEOF()) { - CString line = f.GetLine(); - if (f.GetError() != 0) + CString line; + int ret = f.GetLine( line ); + if( ret == 0 ) + break; + if( ret == -1 ) { - f.ClearError(); - continue; + LOG->Trace("Error reading %s: %s", filename.c_str(), f.GetError().c_str() ); + break; } + if(line.size() > 0 && utf8_get_char(line.c_str()) == 0xFEFF) { /* Annoying header that Windows puts on UTF-8 plaintext