diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-02-01 22:17:36 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-02-01 22:17:36 +0000 |
commit | 886a3106db6d6a60d2d706d2caad3e883dd70b14 (patch) | |
tree | 0fcd0fb9c8821f06d47e7e20e8c796e085e8aa2b /windows | |
parent | 427f127fa9d42cdf9005d06813c580d18d5e0d6a (diff) | |
download | netsurf-886a3106db6d6a60d2d706d2caad3e883dd70b14.tar.gz netsurf-886a3106db6d6a60d2d706d2caad3e883dd70b14.tar.bz2 |
move utf8 local conversion operations to table
Diffstat (limited to 'windows')
-rw-r--r-- | windows/font.c | 11 | ||||
-rw-r--r-- | windows/gui.h | 1 | ||||
-rw-r--r-- | windows/main.c | 1 |
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; |