diff options
Diffstat (limited to '3rdParty/LibIDN/src/toutf8.c')
-rw-r--r-- | 3rdParty/LibIDN/src/toutf8.c | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/3rdParty/LibIDN/src/toutf8.c b/3rdParty/LibIDN/src/toutf8.c index 0d82717..b7126e2 100644 --- a/3rdParty/LibIDN/src/toutf8.c +++ b/3rdParty/LibIDN/src/toutf8.c @@ -1,26 +1,34 @@ /* toutf8.c --- Convert strings from system locale into UTF-8. - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson - * - * This file is part of GNU Libidn. - * - * GNU Libidn is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GNU Libidn 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GNU Libidn; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - * - */ + Copyright (C) 2002-2015 Simon Josefsson + + This file is part of GNU Libidn. + + GNU Libidn is free software: you can redistribute it and/or + modify it under the terms of either: + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at + your option) any later version. + + or + + * 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. + + or both in parallel, as here. + + GNU Libidn 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 copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* Get prototypes. */ @@ -41,25 +49,23 @@ #ifdef _LIBC # define HAVE_ICONV 1 # define HAVE_LOCALE_H 1 # define HAVE_LANGINFO_CODESET 1 #endif -#if HAVE_LOCALE_H -# include <locale.h> -#endif +#include <locale.h> -#if HAVE_LANGINFO_CODESET +#ifdef HAVE_LANGINFO_CODESET # include <langinfo.h> #endif #ifdef _LIBC # define stringprep_locale_charset() nl_langinfo (CODESET) #else /** - * stringprep_locale_charset - return charset used in current locale + * stringprep_locale_charset: * * Find out current locale charset. The function respect the CHARSET * environment variable, but typically uses nl_langinfo(CODESET) when * it is supported. It fall back on "ASCII" if CHARSET isn't set and * nl_langinfo isn't supported or return anything. * @@ -92,13 +98,13 @@ stringprep_locale_charset (void) return "ASCII"; } #endif /** - * stringprep_convert - encode string using new character set + * stringprep_convert: * @str: input zero-terminated string. * @to_codeset: name of destination character set. * @from_codeset: name of origin character set, as used by @str. * * Convert the string from one character set to another using the * system's iconv() function. @@ -121,13 +127,13 @@ stringprep_convert (const char *str, return NULL; return strcpy (p, str); #endif } /** - * stringprep_locale_to_utf8 - convert locale encoded string to UTF-8 + * stringprep_locale_to_utf8: * @str: input zero terminated string. * * Convert string encoded in the locale's character set into UTF-8 by * using stringprep_convert(). * * Return value: Returns newly allocated zero-terminated string which @@ -137,13 +143,13 @@ char * stringprep_locale_to_utf8 (const char *str) { return stringprep_convert (str, "UTF-8", stringprep_locale_charset ()); } /** - * stringprep_utf8_to_locale - encode UTF-8 string to locale encoding + * stringprep_utf8_to_locale: * @str: input zero terminated string. * * Convert string encoded in UTF-8 into the locale's character set by * using stringprep_convert(). * * Return value: Returns newly allocated zero-terminated string which |