![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fciconv.h"#include "fc_config.h"#include "fcintl.h"#include <cstdarg>#include <cstdio>#include <QLocale>#include <QTextCodec>#include <QTextStream>
Include dependency graph for fciconv.cpp:Go to the source code of this file.
Functions | |
| void | init_character_encodings (const char *my_internal_encoding, bool my_use_transliteration) |
| Must be called during the initialization phase of server and client to initialize the character encodings to be used. More... | |
| const char * | get_internal_encoding () |
| Return the internal encoding. More... | |
| char * | data_to_internal_string_malloc (const char *text) |
| char * | internal_to_data_string_malloc (const char *text) |
| char * | internal_to_local_string_malloc (const char *text) |
| char * | local_to_internal_string_malloc (const char *text) |
| char * | local_to_internal_string_buffer (const char *text, char *buf, size_t bufsz) |
| void | fc_fprintf (FILE *stream, const char *format,...) |
| Do a fprintf from the internal charset into the local charset. More... | |
| size_t | get_internal_string_length (const char *text) |
| Return the length, in characters, of the string. More... | |
Variables | |
| static QTextCodec * | localCodec |
| static QTextCodec * | dataCodec |
| static QTextCodec * | internalCodec |
| static const char * | transliteration_string |
| static const char * | local_encoding |
| static const char * | data_encoding |
| static const char * | internal_encoding |
| char* data_to_internal_string_malloc | ( | const char * | text | ) |
Definition at line 92 of file fciconv.cpp.
Referenced by get_conv().
| void fc_fprintf | ( | FILE * | stream, |
| const char * | format, | ||
| ... | |||
| ) |
Do a fprintf from the internal charset into the local charset.
Definition at line 132 of file fciconv.cpp.
Referenced by client_main(), dont_run_as_root(), main(), re_parse_cmdline(), and rup_parse_cmdline().
| const char* get_internal_encoding | ( | ) |
Return the internal encoding.
This depends on the server or GUI being used.
Definition at line 90 of file fciconv.cpp.
Referenced by client_main(), main(), and srv_init().
| size_t get_internal_string_length | ( | const char * | text | ) |
Return the length, in characters, of the string.
This can be used in place of qstrlen in some places because it returns the number of characters not the number of bytes (with multi-byte characters in UTF-8, the two may not be the same).
Use of this function outside of GUI layout code is probably a hack. For instance the demographics code uses it, but this should instead pass the data directly to the GUI library for formatting.
Definition at line 153 of file fciconv.cpp.
Referenced by dem_line_item(), helptext_extra(), insert_generated_text(), insert_veteran_help(), and report_demographics().
| void init_character_encodings | ( | const char * | my_internal_encoding, |
| bool | my_use_transliteration | ||
| ) |
Must be called during the initialization phase of server and client to initialize the character encodings to be used.
Pass an internal encoding of nullptr to use the local encoding internally.
Definition at line 39 of file fciconv.cpp.
Referenced by client_main(), fcmp_init(), main(), and srv_init().
| char* internal_to_data_string_malloc | ( | const char * | text | ) |
Definition at line 99 of file fciconv.cpp.
Referenced by put_conv().
| char* internal_to_local_string_malloc | ( | const char * | text | ) |
Definition at line 106 of file fciconv.cpp.
Referenced by fc_fopen(), fc_remove(), fc_stat(), and generic_generator().
| char* local_to_internal_string_buffer | ( | const char * | text, |
| char * | buf, | ||
| size_t | bufsz | ||
| ) |
Definition at line 120 of file fciconv.cpp.
Referenced by big_int_to_text(), and fc_strerror().
| char* local_to_internal_string_malloc | ( | const char * | text | ) |
Definition at line 113 of file fciconv.cpp.
Referenced by generic_generator(), and freeciv::server::input_on_stdin().
|
static |
Definition at line 31 of file fciconv.cpp.
Referenced by init_character_encodings().
|
static |
Definition at line 27 of file fciconv.cpp.
Referenced by data_to_internal_string_malloc(), init_character_encodings(), and internal_to_data_string_malloc().
|
static |
Definition at line 31 of file fciconv.cpp.
Referenced by get_internal_encoding(), and init_character_encodings().
|
static |
Definition at line 28 of file fciconv.cpp.
Referenced by data_to_internal_string_malloc(), init_character_encodings(), internal_to_data_string_malloc(), internal_to_local_string_malloc(), local_to_internal_string_buffer(), and local_to_internal_string_malloc().
|
static |
Definition at line 31 of file fciconv.cpp.
Referenced by init_character_encodings().
|
static |
Definition at line 26 of file fciconv.cpp.
Referenced by init_character_encodings(), internal_to_local_string_malloc(), local_to_internal_string_buffer(), and local_to_internal_string_malloc().
|
static |
Definition at line 30 of file fciconv.cpp.
Referenced by init_character_encodings().