]> granicus.if.org Git - graphviz/commitdiff
add UTF8 rtest case from b993
authorellson <devnull@localhost>
Tue, 15 Aug 2006 13:41:53 +0000 (13:41 +0000)
committerellson <devnull@localhost>
Tue, 15 Aug 2006 13:41:53 +0000 (13:41 +0000)
support charset=utf8 as synonym for charset="utf-8"
add charset=latin1 to latin1 examples and rtest cases

lib/common/input.c

index 9224da669fce654870ad3d559fcc52c39752cc05..d98b967417898f178a983893f4b10184e88d91ac 100644 (file)
@@ -483,19 +483,24 @@ static int findCharset (graph_t * g)
     char* p;
 
     p = late_nnstring(g,agfindattr(g,"charset"),"utf-8");
-    if (!strcasecmp(p,"latin1") || !strcasecmp(p,"ISO-8859-1") ||
-       !strcasecmp(p,"l1") || !strcasecmp(p,"ISO_8859-1") ||
-       !strcasecmp(p,"ISO8859-1") || !strcasecmp(p,"ISO-IR-100"))
-       enc = CHAR_LATIN1; 
-    else if (!strcasecmp(p,"big-5") || !strcasecmp(p,"big5")) 
-       enc = CHAR_BIG5; 
-    else if (!strcasecmp(p,"utf-8"))
-       enc = CHAR_UTF8; 
+    if (!strcasecmp(p,"latin-1")
+       || !strcasecmp(p,"latin1")
+       || !strcasecmp(p,"l1")
+       || !strcasecmp(p,"ISO-8859-1")
+       || !strcasecmp(p,"ISO_8859-1")
+       || !strcasecmp(p,"ISO8859-1")
+       || !strcasecmp(p,"ISO-IR-100"))
+               enc = CHAR_LATIN1; 
+    else if (!strcasecmp(p,"big-5")
+       || !strcasecmp(p,"big5")) 
+               enc = CHAR_BIG5; 
+    else if (!strcasecmp(p,"utf-8")
+       || !strcasecmp(p,"utf8"))
+               enc = CHAR_UTF8; 
     else {
        agerr(AGWARN, "Unsupported charset \"%s\" - assuming utf-8\n", p);
        enc = CHAR_UTF8; 
     }
-
     return enc;
 }