]> mj.ucw.cz Git - libucw.git/blobdiff - charset/setnames.c
Added the local copy of the regex library back.
[libucw.git] / charset / setnames.c
index 0e9a853c1b9a4bdecc197e4c044c9b97bcdeb6b5..ff723ec2c87c55d51a8365b6743dd365b2836d08 100644 (file)
@@ -2,6 +2,7 @@
  *     Character Set Conversion Library 1.0 -- Character Set Names
  *
  *     (c) 1998--2005 Martin Mares <mj@ucw.cz>
+ *     (c) 2007 Pavel Charvat <pchar@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU General Public License.
@@ -12,9 +13,9 @@
 
 #include <string.h>
 
-/* RFC-based names */
+/* Names according to RFC 1345 (see http://www.iana.org/assignments/character-sets) */
 
-static char *cs_names[] = {
+static const char *cs_names[] = {
        "US-ASCII",
        "ISO-8859-1",
        "ISO-8859-2",
@@ -39,11 +40,13 @@ static char *cs_names[] = {
        "cp852",
        "x-mac-ce",
        "x-cork",
-       "utf-8"
+       "utf-8",
+       "utf-16be",
+       "utf-16le"
 };
 
 int
-find_charset_by_name(char *c)
+find_charset_by_name(const char *c)
 {
        unsigned int i;
 
@@ -59,5 +62,5 @@ charset_name(int i)
   if (i < 0 || i > CONV_NUM_CHARSETS)
     return "x-unknown";
   else
-    return cs_names[i];
+    return (char *)cs_names[i];
 }