summaryrefslogtreecommitdiff
path: root/library/misc.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:52:08 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:52:08 +0200
commita81ead8928b6e0b880a7d889d8312e140f42dd39 (patch)
treeed43bbb7bda24efded7545ed0f7b7447e2683414 /library/misc.cpp
parent1.8 (diff)
downloadFreeFileSync-a81ead8928b6e0b880a7d889d8312e140f42dd39.tar.gz
FreeFileSync-a81ead8928b6e0b880a7d889d8312e140f42dd39.tar.bz2
FreeFileSync-a81ead8928b6e0b880a7d889d8312e140f42dd39.zip
1.9
Diffstat (limited to 'library/misc.cpp')
-rw-r--r--library/misc.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/library/misc.cpp b/library/misc.cpp
index 7d798ec0..71bbe608 100644
--- a/library/misc.cpp
+++ b/library/misc.cpp
@@ -4,6 +4,8 @@
#include "resources.h"
#include "globalFunctions.h"
+const string CustomLocale::FfsLanguageDat = "language.dat";
+
void exchangeEscapeChars(wxString& data)
{
data.Replace(wxT("\\\\"), wxT("\\"));
@@ -23,14 +25,14 @@ CustomLocale::CustomLocale() :
CustomLocale::~CustomLocale()
{
//write language to file
- ofstream output("lang.dat");
+ ofstream output(FfsLanguageDat.c_str());
if (output)
{
globalFunctions::writeInt(output, currentLanguage);
output.close();
}
else
- wxMessageBox(wxString(_("Could not write to ")) + wxT("\"") + wxT("lang.dat") + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
+ wxMessageBox(wxString(_("Could not write to ")) + wxT("\"") + wxString::From8BitData(FfsLanguageDat.c_str()) + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
}
@@ -39,7 +41,7 @@ void CustomLocale::loadLanguageFromCfg() //retrieve language from config file:
int language = wxLANGUAGE_ENGLISH;
//try to load language setting from file
- ifstream input("lang.dat");
+ ifstream input(FfsLanguageDat.c_str());
if (input)
{
language = globalFunctions::readInt(input);
@@ -86,15 +88,15 @@ void CustomLocale::loadLanguageFile(int language)
//Delimiter:
//----------
- //Linux: 0xa
- //Mac: 0xd
- //Win: 0xd 0xa <- language files are in Windows format
+ //Linux: 0xa \n
+ //Mac: 0xd \r
+ //Win: 0xd 0xa \r\n <- language files are in Windows format
while (langFile.getline(temp, bufferSize, 0xd)) //specify delimiter explicitely
{
langFile.get(); //discard the 0xa character
- //wxString formattedString = wxString::FromUTF8(temp);
- wxString formattedString = wxString::From8BitData(temp);
+ wxString formattedString = wxString::FromUTF8(temp);
+ //wxString formattedString = wxString::From8BitData(temp);
exchangeEscapeChars(formattedString);
bgstack15