X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fi18n.c;h=fe749dff181cda0b6144010f74c171d97870a49a;hb=b078357653b9eebbba49a088c81c3dd935b58698;hp=bc0db0b896426c094b305382141a6a3e69959cdb;hpb=f790dbda9d498eef9c9c0a49078adbeecf768d56;p=pspp diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index bc0db0b896..fe749dff18 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -264,10 +264,10 @@ recode_string_pool (const char *to, const char *from, { struct substring out; - if ( text == NULL ) + if (text == NULL) return NULL; - if ( length == -1 ) + if (length == -1) length = strlen (text); out = recode_substring_pool (to, from, ss_buffer (text, length), pool); @@ -563,7 +563,7 @@ recode_substring_pool__ (const char *to, const char *from, conv = create_iconv (to, from); - if ( NULL == conv ) + if (NULL == conv) { if (fallbackchar) { @@ -685,7 +685,7 @@ set_encoding_from_locale (const char *loc) loc_encoding = xstrdup (locale_charset ()); - if ( 0 == strcmp (loc_encoding, c_encoding)) + if (0 == strcmp (loc_encoding, c_encoding)) { ok = false; } @@ -737,7 +737,7 @@ valid_encoding (const char *enc) { iconv_t conv = iconv_open (UTF8, enc); - if ( conv == (iconv_t) -1) + if (conv == (iconv_t) -1) return false; iconv_close (conv); @@ -952,6 +952,12 @@ utf8_to_lower (const char *s) { return utf8_casemap (s, u8_tolower); } + +char * +utf8_to_title (const char *s) +{ + return utf8_casemap (s, u8_totitle); +} bool get_encoding_info (struct encoding_info *e, const char *name)