1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Fixed base64 issue with UTF-8 strings

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
This commit is contained in:
William Langford
2014-07-01 13:17:48 -04:00
committed by Nicolas Williams
parent ba1acbe961
commit 9f4d7e2fb8
2 changed files with 6 additions and 1 deletions

View File

@@ -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<len; i+=3) {
uint32_t code = 0;