liblcf
|
Functions | |
std::string | CodepageToEncoding (int codepage) |
std::string | DetectEncoding (const std::string &database_file) |
std::string | GetEncoding (const std::string &ini_file) |
std::string | GetLocaleEncoding () |
std::string | Recode (const std::string &str_to_encode, const std::string &source_encoding) |
std::string | Recode (const std::string &str_to_encode, const std::string &src_enc, const std::string &dst_enc) |
ReaderUtil namespace.
std::string ReaderUtil::CodepageToEncoding | ( | int | codepage | ) |
Returns the encoding name of a windows numeric codepage.
codepage | codepage to lookup. |
Definition at line 43 of file reader_util.cpp.
Referenced by GetEncoding(), GetLocaleEncoding(), and Recode().
std::string ReaderUtil::DetectEncoding | ( | const std::string & | database_file | ) |
Detects the encoding based on text analysis.
text | a string with few hundred of words to analyze. |
Definition at line 73 of file reader_util.cpp.
References RPG::Terms::accessory, RPG::Terms::agility, RPG::Terms::armor, RPG::Terms::attack, RPG::Terms::defense, RPG::Terms::exit_game, RPG::Terms::exit_game_message, RPG::Terms::exp_short, RPG::Terms::file, RPG::Terms::health_points, RPG::Terms::helmet, RPG::Terms::hp_short, RPG::Terms::level, LDB_Reader::Load(), RPG::Terms::load_game, RPG::Terms::load_game_message, RPG::Terms::lvl_short, RPG::Terms::menu_quit, RPG::Terms::menu_save, RPG::Terms::new_game, RPG::Terms::no, RPG::Terms::normal_status, RPG::Terms::order, RPG::Terms::row, RPG::Terms::save_game_message, RPG::Terms::shield, RPG::Terms::sp_cost, RPG::Terms::sp_short, RPG::Terms::spirit, RPG::Terms::spirit_points, RPG::Terms::status, Data::terms, RPG::Terms::wait_off, RPG::Terms::wait_on, RPG::Terms::weapon, and RPG::Terms::yes.
std::string ReaderUtil::GetEncoding | ( | const std::string & | ini_file | ) |
Returns the encoding set in the ini file.
ini_file | The ini file to parse. |
Definition at line 172 of file reader_util.cpp.
References CodepageToEncoding(), INIReader::Get(), and INIReader::ParseError().
std::string ReaderUtil::GetLocaleEncoding | ( | ) |
Returns the system encoding based on current locale settings.
Definition at line 183 of file reader_util.cpp.
References CodepageToEncoding().
std::string ReaderUtil::Recode | ( | const std::string & | str_to_encode, |
const std::string & | source_encoding | ||
) |
Converts a string to unicode.
str_to_encode | string to encode |
source_encoding | Encoding of str_to_encode |
Definition at line 236 of file reader_util.cpp.
Referenced by LcfWriter::Decode(), and LcfReader::Encode().
std::string ReaderUtil::Recode | ( | const std::string & | str_to_encode, |
const std::string & | src_enc, | ||
const std::string & | dst_enc | ||
) |
Converts a string between encodings.
str_to_encode | the string to convert. |
src_enc | the source encoding. |
dst_enc | the destination encoding. |
Definition at line 240 of file reader_util.cpp.
References CodepageToEncoding().