gretl_intl

gretl_intl

Functions

void gretl_push_c_numeric_locale ()
void gretl_pop_c_numeric_locale ()
int doing_nls ()
int reset_local_decpoint ()
int get_local_decpoint ()
char * iso_to_ascii ()
char * u8_to_ascii_convert ()
char * asciify_utf8_varname ()
const char * lang_string_from_id ()
char * utf8_to_rtf ()
int iso_latin_version ()
int lang_id_from_name ()
int lang_id_from_code ()
void set_alt_gettext_mode ()
void set_lcnumeric ()
int gretl_is_ascii ()
int force_language ()
int test_locale ()
int gretl_recode_file ()
int chinese_locale ()
int japanese_locale ()
int east_asian_locale ()
int get_utf_width ()
char * iso_gettext ()
char * alt_gettext ()
void set_gretl_charset ()
void set_native_utf8 ()
char * sprint_l2_to_ascii ()
int get_translated_width ()
#define UTF_WIDTH()
#define TRANSLATED_WIDTH()
#define gettext()

Types and Values

Description

Functions

gretl_push_c_numeric_locale ()

void
gretl_push_c_numeric_locale (void);

Saves the current LC_NUMERIC locale and sets it to "C". This way you can safely read/write floating point numbers all in the same format, using '.' as the decimal character. You should make sure that code between gretl_push_c_numeric_locale() and gretl_pop_c_numeric_locale() doesn't do any setlocale calls, or locale may end up in a strange setting. Also make sure to always pop the C numeric locale after you've pushed it. The calls can be nested.


gretl_pop_c_numeric_locale ()

void
gretl_pop_c_numeric_locale (void);

Restores the LC_NUMERIC locale to what it was before the matching gretl_push_c_numeric_locale(). If these calls were nested, then this is a no-op until we get to the most outermost layer. Code in between these should not do any setlocale calls to change the LC_NUMERIC locale or things may come out very strange.


doing_nls ()

int
doing_nls (void);

Returns

1 if NLS translation is in effect, 0 otherwise.


reset_local_decpoint ()

int
reset_local_decpoint (void);

Uses localeconv() to determine the representation of the decimal point in the current locale.

Returns

the decimal character for the current locale.


get_local_decpoint ()

int
get_local_decpoint (void);

Returns

the decimal character for the current locale.


iso_to_ascii ()

char *
iso_to_ascii (char *s);

u8_to_ascii_convert ()

char *
u8_to_ascii_convert (char *targ,
                     const char *src,
                     int maxlen,
                     char sub);

asciify_utf8_varname ()

char *
asciify_utf8_varname (char *s);

lang_string_from_id ()

const char *
lang_string_from_id (int langid);

utf8_to_rtf ()

char *
utf8_to_rtf (const char *s);

iso_latin_version ()

int
iso_latin_version (void);

lang_id_from_name ()

int
lang_id_from_name (const char *s);

lang_id_from_code ()

int
lang_id_from_code (const char *s);

set_alt_gettext_mode ()

void
set_alt_gettext_mode (PRN *prn);

set_lcnumeric ()

void
set_lcnumeric (int langid,
               int lcnumeric);

gretl_is_ascii ()

int
gretl_is_ascii (const char *buf);

force_language ()

int
force_language (int langid);

test_locale ()

int
test_locale (const char *langstr);

gretl_recode_file ()

int
gretl_recode_file (const char *path1,
                   const char *path2,
                   const char *from_set,
                   const char *to_set,
                   PRN *prn);

Parameters

path1

path to original file.

 

path2

path to file to be written.

 

from_set

the codeset of the original file.

 

to_set

the codeset for the recoded file.

 

prn

gretl printer (for a few comments) or NULL.

 

Returns

0 on success or non-zero code on error.


chinese_locale ()

int
chinese_locale (void);

japanese_locale ()

int
japanese_locale (void);

east_asian_locale ()

int
east_asian_locale (void);

get_utf_width ()

int
get_utf_width (const char *str,
               int width);

iso_gettext ()

char *
iso_gettext (const char *msgid);

alt_gettext ()

char *
alt_gettext (const char *msgid);

set_gretl_charset ()

void
set_gretl_charset (void);

set_native_utf8 ()

void
set_native_utf8 (int s);

sprint_l2_to_ascii ()

char *
sprint_l2_to_ascii (char *targ,
                    const char *s,
                    size_t len);

get_translated_width ()

int
get_translated_width (const char *str);

UTF_WIDTH()

# define UTF_WIDTH(s, w) get_utf_width(s, w) 

TRANSLATED_WIDTH()

# define TRANSLATED_WIDTH(s) get_translated_width(s)

gettext()

#define gettext(s) s

Types and Values

enum GretlLangCode

Members

LANG_AUTO

   

LANG_C

   

LANG_SQ

   

LANG_EU

   

LANG_BG

   

LANG_CA

   

LANG_ZH_TW

   

LANG_CS

   

LANG_FR

   

LANG_GL

   

LANG_DE

   

LANG_EL

   

LANG_IT

   

LANG_JA

   

LANG_PL

   

LANG_PT

   

LANG_PT_BR

   

LANG_RO

   

LANG_RU

   

LANG_ES

   

LANG_TR

   

LANG_UK

   

LANG_MAX