summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
Diffstat (limited to 'windows')
-rw-r--r--windows/font.c11
-rw-r--r--windows/gui.h1
-rw-r--r--windows/main.c1
3 files changed, 11 insertions, 2 deletions
diff --git a/windows/font.c b/windows/font.c
index 98269a35f..09adeeda7 100644
--- a/windows/font.c
+++ b/windows/font.c
@@ -43,14 +43,14 @@ nserror utf8_to_font_encoding(const struct font_desc* font,
return utf8_to_enc(string, font->encoding, len, result);
}
-nserror utf8_to_local_encoding(const char *string,
+static nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
return utf8_to_enc(string, "UCS-2", len, result);
}
-nserror utf8_from_local_encoding(const char *string, size_t len,
+static nserror utf8_from_local_encoding(const char *string, size_t len,
char **result)
{
assert(string && result);
@@ -234,3 +234,10 @@ const struct font_functions nsfont = {
nsfont_position_in_string,
nsfont_split
};
+
+static struct gui_utf8_table utf8_table = {
+ .utf8_to_local = utf8_to_local_encoding,
+ .local_to_utf8 = utf8_from_local_encoding,
+};
+
+struct gui_utf8_table *win32_utf8_table = &utf8_table;
diff --git a/windows/gui.h b/windows/gui.h
index 1ff849d73..d8e1b1d0b 100644
--- a/windows/gui.h
+++ b/windows/gui.h
@@ -28,6 +28,7 @@ extern struct gui_window_table *win32_window_table;
extern struct gui_clipboard_table *win32_clipboard_table;
extern struct gui_fetch_table *win32_fetch_table;
extern struct gui_browser_table *win32_browser_table;
+extern struct gui_utf8_table *win32_utf8_table;
extern HINSTANCE hInstance;
diff --git a/windows/main.c b/windows/main.c
index 94e0eee2e..6a53e0c72 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -111,6 +111,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
.clipboard = win32_clipboard_table,
.download = win32_download_table,
.fetch = win32_fetch_table,
+ .utf8 = win32_utf8_table,
};
win32_fetch_table->get_resource_url = gui_get_resource_url;