+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
+Mon Sep 18 10:58:21 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gutf8.c: Implement g_ucs4_to_utf8 which was in
+ the header file but not implemented.
+
Sun Sep 17 2000 Elliot Lee <sopwith@redhat.com>
- * glib.h configure.in: Define g_alloca() as an alloca-that-works-anywhere.
- * gconvert.c: Fix warnings which could have caused problems on 64-bit platforms.
+
+ * glib.h configure.in: Define g_alloca() as an
+ alloca-that-works-anywhere.
+
+ * gconvert.c: Fix warnings which could have caused problems on
+ 64-bit platforms.
Sun Sep 10 12:37:40 2000 Owen Taylor <otaylor@redhat.com>
</para>
-@err:
-<!--
+@err: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../glib-docs.sgml" "book" "refsect2" "")
return result;
}
+/**
+ * g_ucs4_to_utf8:
+ * @str: a UCS-4 encoded string
+ * @len: the length of @
+ *
+ * Convert a string from a 32-bit fixed width representation as UCS-4.
+ * to UTF-8.
+ *
+ * Return value: a pointer to a newly allocated UTF-8 string.
+ * This value must be freed with g_free()
+ **/
+gchar *
+g_ucs4_to_utf8 (const gunichar *str, int len)
+{
+ gint result_length;
+ gchar *result, *p;
+ gint i;
+
+ result_length = 0;
+ for (i = 0; i < len ; i++)
+ result_length += g_unichar_to_utf8 (str[i], NULL);
+
+ result_length++;
+
+ result = g_malloc (result_length + 1);
+ p = result;
+
+ for (i = 0; i < len ; i++)
+ p += g_unichar_to_utf8 (str[i], p);
+
+ *p = '\0';
+
+ return result;
+}
+
/**
* g_utf8_validate:
* @str: a pointer to character data
return result;
}
+/**
+ * g_ucs4_to_utf8:
+ * @str: a UCS-4 encoded string
+ * @len: the length of @
+ *
+ * Convert a string from a 32-bit fixed width representation as UCS-4.
+ * to UTF-8.
+ *
+ * Return value: a pointer to a newly allocated UTF-8 string.
+ * This value must be freed with g_free()
+ **/
+gchar *
+g_ucs4_to_utf8 (const gunichar *str, int len)
+{
+ gint result_length;
+ gchar *result, *p;
+ gint i;
+
+ result_length = 0;
+ for (i = 0; i < len ; i++)
+ result_length += g_unichar_to_utf8 (str[i], NULL);
+
+ result_length++;
+
+ result = g_malloc (result_length + 1);
+ p = result;
+
+ for (i = 0; i < len ; i++)
+ p += g_unichar_to_utf8 (str[i], p);
+
+ *p = '\0';
+
+ return result;
+}
+
/**
* g_utf8_validate:
* @str: a pointer to character data