* WINTERMUTE: Add detection for "The Driller Incident" "The Driller Incident" is a small freeware game for Wintermute, avaliable in English and Russian: http://questzone.ru/enzi/files/1645 * WINTERMUTE: Add detection table for "One Helluva Day" demo "One Helluva Day" is a point-and-click adventure demo in English / Czech / Russian. Free download: https://store.steampowered.com/app/603680/One_helluva_day/ * WINTERMUTE: Support CHARSET property for TT fonts "// we don't need this anymore" was a mistake =) Surely, most Wintermute games are either designed for 1252 language (DE_DEU, EN_ANY, ES_ESP, FR_FRA, IT_ITA, PT_BRA), or don't use TrueType fonts (5ma, deadcity, grotter1, grotter2, thekite, tib), or use CHARSET=1 with UTF strings (dirtysplit, reversion1, reversion2, twc), which meen this conversion is not needed for those games. However, there are some games that explicitly states CHARSET=10 (driller (RU_RUS), oknytt (RU_RUS), onehelluvaday (UNK_LANG when playing as Russian)) and there are some games with CHARSET=1 with non-1252 in mind (bookofgron (RU_RUS excepts 1251), carolreed4 (RU_RUS excepts 1251), kulivocko (CZ_CZE excepts 1250)). This fixes text in some games: bookofgron, carolreed4, driller, kulivocko, oknytt, onehelluvaday. * WINTERMUTE: Break savegame compatibility sizeof(BaseFontTT) was changed, so let's break savegame compatibility * COMMON: Add conversion tables for win1253 and win1257 * COMMON: Add string conversion from U32String back to Common::String convertUtf32ToUtf8 code is based on Wintermute::ConvertUTF32toUTF8 convertFromU32String use convertUtf32ToUtf8 for UTF8 or lookup through conversion table for single-byte encodings * WINTERMUTE: Use Common::convert functions for non-UTF charsets * WINTERMUTE: Fix whitespaces at detection tables * WINTERMUTE: Add TODO comments
59 lines
2.1 KiB
C++
59 lines
2.1 KiB
C++
/* ScummVM - Graphic Adventure Engine
|
|
*
|
|
* ScummVM is the legal property of its developers, whose names
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
* file distributed with this source distribution.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* This file is based on WME Lite.
|
|
* http://dead-code.org/redir.php?target=wmelite
|
|
* Copyright (c) 2011 Jan Nedoma
|
|
*/
|
|
|
|
#ifndef WINTERMUTE_STRINGUTIL_H
|
|
#define WINTERMUTE_STRINGUTIL_H
|
|
|
|
#include "engines/wintermute/dctypes.h"
|
|
|
|
namespace Wintermute {
|
|
|
|
class StringUtil {
|
|
public:
|
|
static bool compareNoCase(const AnsiString &str1, const AnsiString &str2);
|
|
//static bool compareNoCase(const WideString &str1, const WideString &str2);
|
|
static WideString utf8ToWide(const Utf8String &Utf8Str);
|
|
static Utf8String wideToUtf8(const WideString &WideStr);
|
|
static WideString ansiToWide(const AnsiString &str, TTextCharset charset = CHARSET_ANSI);
|
|
static AnsiString wideToAnsi(const WideString &str, TTextCharset charset = CHARSET_ANSI);
|
|
|
|
static bool isUtf8BOM(const byte *buffer, uint32 bufferSize);
|
|
static int indexOf(const WideString &str, const WideString &toFind, size_t startFrom);
|
|
|
|
static Common::String encodeSetting(const Common::String &str);
|
|
static Common::String decodeSetting(const Common::String &str);
|
|
|
|
static AnsiString toString(int val);
|
|
|
|
private:
|
|
static Common::CodePage mapCodePage(TTextCharset charset);
|
|
};
|
|
|
|
} // End of namespace Wintermute
|
|
|
|
#endif
|