Commit 5bc29613 authored by eric@webkit.org's avatar eric@webkit.org

2010-01-27 Dominik Röttsches <dominik.roettsches@access-company.com>

        Reviewed by Xan Lopez.

        [Gtk] For removing ICU, implement IDN support by means of libidn
        https://bugs.webkit.org/show_bug.cgi?id=31470

        In order to avoid a new dependency,
        IDN support now based on GLib for the GLib unicode backend.

        * platform/KURL.cpp:
        (WebCore::appendEncodedHostname):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cea2f435
2010-01-27 Dominik Röttsches <dominik.roettsches@access-company.com>
Reviewed by Xan Lopez.
[Gtk] For removing ICU, implement IDN support by means of libidn
https://bugs.webkit.org/show_bug.cgi?id=31470
In order to avoid a new dependency,
IDN support now based on GLib for the GLib unicode backend.
* platform/KURL.cpp:
(WebCore::appendEncodedHostname):
2010-01-27 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
......@@ -38,6 +38,9 @@
#include <unicode/uidna.h>
#elif USE(QT4_UNICODE)
#include <QUrl>
#elif USE(GLIB_UNICODE)
#include <glib.h>
#include <wtf/gtk/GOwnPtr.h>
#endif
#include <stdio.h>
......@@ -1410,6 +1413,19 @@ static void appendEncodedHostname(UCharBuffer& buffer, const UChar* str, unsigne
#elif USE(QT4_UNICODE)
QByteArray result = QUrl::toAce(String(str, strLen));
buffer.append(result.constData(), result.length());
#elif USE(GLIB_UNICODE)
GOwnPtr<gchar> utf8Hostname;
GOwnPtr<GError> utf8Err;
utf8Hostname.set(g_utf16_to_utf8(str, strLen, 0, 0, &utf8Err.outPtr()));
if (utf8Err)
return;
GOwnPtr<gchar> encodedHostname;
encodedHostname.set(g_hostname_to_ascii(utf8Hostname.get()));
if (!encodedHostname)
return;
buffer.append(encodedHostname.get(), strlen(encodedHostname.get()));
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment