From d0cbe697d988315c0a2f107d57da556eae58ecc1 Mon Sep 17 00:00:00 2001 From: Dietrich Epp Date: Tue, 16 Mar 2021 13:08:31 -0400 Subject: [PATCH] Fix UTF-8 to Macintosh charset conversion GitOrigin-RevId: f0d7fbd465cb5955be3bbde135801e1fd9701e33 --- mac_from_unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mac_from_unix.c b/mac_from_unix.c index 3378ca4..6f60748 100644 --- a/mac_from_unix.c +++ b/mac_from_unix.c @@ -61,7 +61,7 @@ int mac_from_unix(unsigned char **outptr, unsigned char *outend, curvalue = 0; } do { - entry = table[*ip++]; + entry = table[state | *ip++]; state = entry & 0xff00; value = entry & 0xff; if (value != 0) { @@ -77,6 +77,7 @@ int mac_from_unix(unsigned char **outptr, unsigned char *outend, } ip = curpos; *op++ = curvalue; + last = 0; } } *outptr = op;