From: William Langford Date: Tue, 1 Jul 2014 17:17:48 +0000 (-0400) Subject: Fixed base64 issue with UTF-8 strings X-Git-Tag: jq-1.5rc1~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f4d7e2fb85951ec93e4ee1b99072d5517658db5;p=jq Fixed base64 issue with UTF-8 strings Signed-off-by: Nicolas Williams --- diff --git a/builtin.c b/builtin.c index 8a809f5..6a1d796 100644 --- a/builtin.c +++ b/builtin.c @@ -454,7 +454,7 @@ static jv f_format(jv input, jv fmt) { input = f_tostring(input); jv line = jv_string(""); const char b64[64 + 1] = CHARS_ALPHANUM "+/"; - const char* data = jv_string_value(input); + const unsigned char* data = (const unsigned char*)jv_string_value(input); int len = jv_string_length_bytes(jv_copy(input)); for (int i=0; i&'\\''\"'" "PD4mJyI=" +# regression test for #436 +@base64 +"foóbar\n" +"Zm/Ds2Jhcgo=" + @uri "\u03bc" "%CE%BC"