[webkit-reviews] review denied: [Bug 31470] [Gtk] For removing ICU, implement IDN support by means of libidn : [Attachment 44621] IDN support through libidn
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 14 04:13:47 PST 2010
Xan Lopez <xan.lopez at gmail.com> has denied Dominik Röttsches
<dominik.roettsches at access-company.com>'s request for review:
Bug 31470: [Gtk] For removing ICU, implement IDN support by means of libidn
https://bugs.webkit.org/show_bug.cgi?id=31470
Attachment 44621: IDN support through libidn
https://bugs.webkit.org/attachment.cgi?id=44621&action=review
------- Additional Comments from Xan Lopez <xan.lopez at gmail.com>
>+#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])
More information about the webkit-reviews
mailing list