diff options
author | Ole Loots <ole@monochrom.net> | 2014-09-12 23:22:26 +0200 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2014-09-12 23:22:26 +0200 |
commit | a9ac9c00fc2c73705db242a459160f14d279cdcd (patch) | |
tree | 5f9aa630340bad67934e6fdbfda7f239f0fade57 /atari/encoding.c | |
parent | 181bc41a9aa200cfac5bf4b84175003639fce488 (diff) | |
parent | 9e6b0fb8b07cd3147b0a2727d3644860cf7c8c7e (diff) | |
download | netsurf-a9ac9c00fc2c73705db242a459160f14d279cdcd.tar.gz netsurf-a9ac9c00fc2c73705db242a459160f14d279cdcd.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
Conflicts:
atari/gui.h
Diffstat (limited to 'atari/encoding.c')
-rw-r--r-- | atari/encoding.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/atari/encoding.c b/atari/encoding.c index 0212d51c4..7a60eeeb9 100644 --- a/atari/encoding.c +++ b/atari/encoding.c @@ -16,28 +16,30 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ +#include <stdlib.h> + +#include "desktop/gui.h" + #include "atari/encoding.h" /* TODO: this need a rework..., encoding to atari st doesn|t always work. ( gui_add_to_clipboard...) */
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
- utf8_convert_ret r;
+ nserror r;
r = utf8_to_enc(string, "ATARIST", len, result);
- if(r != UTF8_CONVERT_OK) {
+ if(r != NSERROR_OK) {
r = utf8_to_enc(string, "UTF-8", len, result);
- assert( r == UTF8_CONVERT_OK );
+ assert( r == NSERROR_OK );
}
return r;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
- size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result) {
return utf8_from_enc(string, "ATARIST", len, result, NULL);
}
@@ -69,3 +71,9 @@ int atari_to_ucs4(unsigned char atari) } +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 *atari_utf8_table = &utf8_table; |