From b432b735e4a9475fbc12d6a0f7a87ca45d48b1cf Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 16 Nov 2008 22:32:32 +0200 Subject: [PATCH] bug 1066: Attempt to convert -remote addBookmark(URL) to UTF-8. Currently, it is not clear which codepage is used in struri(). Assume it is the system codepage. --- src/session/session.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/session/session.c b/src/session/session.c index 3df7eb54..0b4ff8c7 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -971,9 +971,16 @@ init_remote_session(struct session *ses, enum remote_session_flags *remote_ptr, } else if (remote & SES_REMOTE_ADD_BOOKMARK) { #ifdef CONFIG_BOOKMARKS + int uri_cp; + if (!uri) return; - /** @todo Bug 1066: add_bookmark() expects UTF-8. */ - add_bookmark(NULL, 1, struri(uri), struri(uri)); + /** @todo Bug 1066: What is the encoding of struri()? + * This code currently assumes the system charset. + * It might be best to keep URIs in plain ASCII and + * then have a function that reversibly converts them + * to IRIs for display in a given encoding. */ + uri_cp = get_cp_index("System"); + add_bookmark_cp(NULL, 1, uri_cp, struri(uri), struri(uri)); #endif } else if (remote & SES_REMOTE_INFO_BOX) {