Remove IDS_LANG_CHARSET and supporting code, everything is in UTF-8 now

Günther Brammer 2011-04-09 02:51:57 +02:00
parent 21e28a4689
commit 9b3afcef04
6 changed files with 3 additions and 40 deletions

View File

@ -1,7 +1,6 @@
IDS_LANG_NAME=Deutsch
IDS_LANG_INFO=Original-Sprachpaket von RedWolf Design.
IDS_LANG_FALLBACK=
IDS_LANG_CHARSET=UTF-8
IDS_BTN_ACCEPT=Annehmen
IDS_BTN_ACTIVATE=Aktivieren
IDS_BTN_BACK=Zurück

View File

@ -1,7 +1,6 @@
IDS_LANG_NAME=English
IDS_LANG_INFO=Original language pack by RedWolf Design.
IDS_LANG_FALLBACK=
IDS_LANG_CHARSET=UTF-8
IDS_BTN_ACCEPT=Accept
IDS_BTN_ACTIVATE=Activate
IDS_BTN_BACK=Back

View File

@ -392,11 +392,6 @@ void C4Language::LoadInfos(C4Group &hGroup)
// Load language string table
if (hGroup.LoadEntry(strEntry, &strTable, 0, 1))
{
if (!SEqual(GetResStr("IDS_LANG_CHARSET", strTable), "UTF-8"))
{
LogF("Translation %s is not in UTF-8, skipped", GetResStr("IDS_LANG_NAME", strTable));
continue;
}
// New language info
C4LanguageInfo *pInfo = new C4LanguageInfo;
// Get language code by entry name

View File

@ -448,7 +448,6 @@ bool C4Network2HTTPClient::Query(const StdBuf &Data, bool fBinary)
// store mode
this->fBinary = fBinary;
// Create request
const char *szCharset = GetCharsetCodeName(LoadResStr("IDS_LANG_CHARSET"));
StdStrBuf Header;
if (Data.getSize())
Header.Format(
@ -456,8 +455,8 @@ bool C4Network2HTTPClient::Query(const StdBuf &Data, bool fBinary)
"Host: %s\r\n"
"Connection: Close\r\n"
"Content-Length: %lu\r\n"
"Content-Type: text/plain; encoding=%s\r\n"
"Accept-Charset: %s\r\n"
"Content-Type: text/plain; charset=utf-8\r\n"
"Accept-Charset: utf-8\r\n"
"Accept-Encoding: gzip\r\n"
"Accept-Language: %s\r\n"
"User-Agent: " C4ENGINENAME "/" C4VERSION "\r\n"
@ -465,22 +464,19 @@ bool C4Network2HTTPClient::Query(const StdBuf &Data, bool fBinary)
RequestPath.getData(),
Server.getData(),
static_cast<unsigned long>(Data.getSize()),
szCharset,
szCharset,
Config.General.LanguageEx);
else
Header.Format(
"GET %s HTTP/1.0\r\n"
"Host: %s\r\n"
"Connection: Close\r\n"
"Accept-Charset: %s\r\n"
"Accept-Charset: utf-8\r\n"
"Accept-Encoding: gzip\r\n"
"Accept-Language: %s\r\n"
"User-Agent: " C4ENGINENAME "/" C4VERSION "\r\n"
"\r\n",
RequestPath.getData(),
Server.getData(),
szCharset,
Config.General.LanguageEx);
// Compose query
Request.Take(Header.GrabPointer(), Header.getLength());

View File

@ -943,27 +943,3 @@ void CStdFont::DrawText(SURFACE sfcDest, float iX, float iY, DWORD dwColor, cons
else
lpDDraw->DeactivateBlitModulation();
}
// The internal clonk charset is one of the windows charsets
// But to save the used one to the configuration, a string is used
// So we need to convert this string to the iconv name for iconv
const char * GetCharsetCodeName(const char *strCharset)
{
// Match charset name to WinGDI codes
if (SEqualNoCase(strCharset, "SHIFTJIS")) return "CP932";
if (SEqualNoCase(strCharset, "HANGUL")) return "CP949";
if (SEqualNoCase(strCharset, "JOHAB")) return "CP1361";
if (SEqualNoCase(strCharset, "CHINESEBIG5")) return "CP950";
if (SEqualNoCase(strCharset, "GREEK")) return "CP1253";
if (SEqualNoCase(strCharset, "TURKISH")) return "CP1254";
if (SEqualNoCase(strCharset, "VIETNAMESE")) return "CP1258";
if (SEqualNoCase(strCharset, "HEBREW")) return "CP1255";
if (SEqualNoCase(strCharset, "ARABIC")) return "CP1256";
if (SEqualNoCase(strCharset, "BALTIC")) return "CP1257";
if (SEqualNoCase(strCharset, "RUSSIAN")) return "CP1251";
if (SEqualNoCase(strCharset, "THAI")) return "CP874";
if (SEqualNoCase(strCharset, "EASTEUROPE")) return "CP1250";
if (SEqualNoCase(strCharset, "UTF-8")) return "UTF-8";
// Default
return "CP1252";
}

View File

@ -147,6 +147,4 @@ public:
{ pCustomImages = pHandler; }
};
const char * GetCharsetCodeName(const char * strCharset);
#endif // INC_STDFONT