[Webkit-unassigned] [Bug 31470] [Gtk] For removing ICU, implement IDN support by means of libidn

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 14 04:13:48 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=31470


Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #44621|review?                     |review-
               Flag|                            |




--- Comment #4 from Xan Lopez <xan.lopez at gmail.com>  2010-01-14 04:13:47 PST ---
(From update of attachment 44621)
>+#elif USE(GLIB_UNICODE)
>+    // first translate to ucs4, libidn is expecting code points 
>+    GOwnPtr<gunichar> ucs4Hostname;
>+    GOwnPtr<GError> ucs4Err;
>+    ucs4Hostname.set(g_utf16_to_ucs4(str, strLen, 0, 0, &ucs4Err.outPtr()));
>+    if (ucs4Err)
>+        return;
>+    char* encodedHostname = 0;
>+    int err;
>+    err = idna_to_ascii_4z(ucs4Hostname.get(), &encodedHostname, IDNA_ALLOW_UNASSIGNED);
>+    if (err == IDNA_SUCCESS)

A nitpick, but I guess retValue or something like that would be better than
'err', since the variable does not necessarily denote an error.

>+        buffer.append(encodedHostname, strlen(encodedHostname));
>+    free(encodedHostname);
> #endif
> }
> 
>Index: autotools/webkit.m4
>===================================================================
>--- autotools/webkit.m4	(revision 51948)
>+++ autotools/webkit.m4	(working copy)
>@@ -166,6 +166,15 @@ fi
> 
> if test "$with_unicode_backend" = "glib"; then
> 	PKG_CHECK_MODULES([UNICODE], [glib-2.0 pango >= 1.21.0])
>+
>+	AC_MSG_CHECKING([for libidn])
>+	AC_CHECK_HEADER(idna.h,
>+		AC_CHECK_LIB(idn, stringprep_check_version,
>+			[libidn=yes UNICODE_LIBS="${UNICODE_LIBS} -lidn"], libidn=no),
>+		libidn=no)
>+	if test "$libidn" = "no" ; then
>+		AC_MSG_ERROR([Libidn not found, needed for GLib unicode backend.])
>+	fi
> fi

I very much prefer to rely on pkg-config for this, as we do everywhere else.

Also, is there any chance this could be folded into glib at some point?
Depending on a new library for a single function is kind of silly.

> 
> AC_SUBST([UNICODE_CFLAGS])

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list