From dcd34e596778ee09c1e18476ec2d2eb55f3e8440 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 15 Nov 2011 15:57:10 +0100 Subject: [PATCH] lib/wind: fix wind_ucs4utf8() and wind_ucs2utf8() Pair-Programmed-With: Arvid Requate metze Signed-off-by: Love Hornquist Astrand --- lib/wind/utf8.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/wind/utf8.c b/lib/wind/utf8.c index 6907b3c9d..fce6defd8 100644 --- a/lib/wind/utf8.c +++ b/lib/wind/utf8.c @@ -204,13 +204,13 @@ wind_ucs4utf8(const uint32_t *in, size_t in_len, char *out, size_t *out_len) switch(len) { case 4: out[3] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 3: out[2] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 2: out[1] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 1: out[0] = ch | first_char[len - 1]; } @@ -479,10 +479,10 @@ wind_ucs2utf8(const uint16_t *in, size_t in_len, char *out, size_t *out_len) switch(len) { case 3: out[2] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 2: out[1] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 1: out[0] = ch | first_char[len - 1]; }