[Swfdec] libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_bits.c

Eric Anholt anholt at kemper.freedesktop.org
Sat Jul 14 09:24:04 PDT 2007


 libswfdec/swfdec_as_interpret.c |    6 +++---
 libswfdec/swfdec_as_string.c    |    8 ++++----
 libswfdec/swfdec_bits.c         |    6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
diff-tree 64695fc1ace7dd173af95cc64686fd1079867638 (from 0a9188fdb36edbe11775ca410f11551090cc7135)
Author: Eric Anholt <eric at anholt.net>
Date:   Sat Jul 14 09:17:29 2007 -0700

    Call the charset UTF-8 instead of UTF8, which FreeBSD's glib doesn't recognize.
    
    Replaces UTF8 everywhere, just for consistency.

diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 53116cb..57e6605 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -1942,7 +1942,7 @@ swfdec_action_char_to_ascii_5 (SwfdecAsC
   const char *s = swfdec_as_value_to_string (cx, val);
 
   char *ascii;
-  ascii = g_convert (s, -1, "LATIN1", "UTF8", NULL, NULL, NULL);
+  ascii = g_convert (s, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
   if (ascii == NULL) {
     /* This can happen if a Flash 5 movie gets loaded into a Flash 7 movie */
     SWFDEC_FIXME ("Someone threw unconvertible text %s at Flash <= 5", s);
@@ -1998,7 +1998,7 @@ swfdec_action_ascii_to_char_5 (SwfdecAsC
   s[0] = ((guint) swfdec_as_value_to_integer (cx, val)) % 256;
   s[1] = 0;
 
-  utf8 = g_convert (s, -1, "UTF8", "LATIN1", NULL, NULL, NULL);
+  utf8 = g_convert (s, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
   if (utf8 == NULL) {
     g_warning ("conversion of character %u failed", (guint) s[0]);
     SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY);
@@ -2025,7 +2025,7 @@ swfdec_action_mb_ascii_to_char_5 (Swfdec
     s[0] = i;
     s[1] = 0;
   }
-  utf8 = g_convert (s, -1, "UTF8", "LATIN1", NULL, NULL, NULL);
+  utf8 = g_convert (s, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
   if (utf8 == NULL) {
     g_warning ("conversion of character %u failed", i);
     SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY);
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index f7c2da9..318a363 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -162,7 +162,7 @@ swfdec_as_string_fromCharCode_5 (SwfdecA
   }
 
   /* FIXME: are these the correct charset names? */
-  s = g_convert ((char *) array->data, array->len, "UTF8", "LATIN1", NULL, NULL, &error);
+  s = g_convert ((char *) array->data, array->len, "UTF-8", "LATIN1", NULL, NULL, &error);
   if (s) {
     SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, s));
     g_free (s);
@@ -481,7 +481,7 @@ swfdec_as_string_unescape_5 (SwfdecAsCon
 }G_STMT_END
   array = g_byte_array_new ();
   msg = swfdec_as_value_to_string (cx, &argv[0]);
-  in = s = g_convert (msg, -1, "LATIN1", "UTF8", NULL, NULL, NULL);
+  in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
   if (s == NULL) {
     SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", msg);
     return;
@@ -521,7 +521,7 @@ swfdec_as_string_unescape_5 (SwfdecAsCon
   }
   cur = 0;
   g_byte_array_append (array, (guchar *) &cur, 1);
-  out = g_convert ((char *) array->data, -1, "UTF8", "LATIN1", NULL, NULL, NULL);
+  out = g_convert ((char *) array->data, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
   if (out) {
     SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, out));
     g_free (out);
@@ -544,7 +544,7 @@ swfdec_as_string_escape (SwfdecAsContext
   array = g_byte_array_new ();
   s = swfdec_as_value_to_string (cx, &argv[0]);
   if (cx->version <= 5) {
-    in = g_convert (s, -1, "LATIN1", "UTF8", NULL, NULL, NULL);
+    in = g_convert (s, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
     if (s == NULL) {
       SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", s);
       return;
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 8a7bfad..9ec3988 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -485,7 +485,7 @@ swfdec_bits_skip_string (SwfdecBits *bit
  * @version: Flash player version
  *
  * Prior to Flash 6, strings used to be encoded as LATIN1. Since Flash 6, 
- * strings are encoded as UTF8. This version does the check automatically
+ * strings are encoded as UTF-8. This version does the check automatically
  * and converts strings to UTF-8.
  *
  * Returns: a UTF-8 encoded string or %NULL on error
@@ -502,9 +502,9 @@ swfdec_bits_get_string_with_version (Swf
     return NULL;
 
   if (version < 6) {
-    char *ret = g_convert (s, -1, "UTF8", "LATIN1", NULL , NULL, NULL);
+    char *ret = g_convert (s, -1, "UTF-8", "LATIN1", NULL , NULL, NULL);
     if (ret == NULL)
-      g_warning ("Could not convert string from LATIN1 to UTF8");
+      g_warning ("Could not convert string from LATIN1 to UTF-8");
     return ret;
   } else {
     if (!g_utf8_validate (s, -1, NULL)) {


More information about the Swfdec mailing list