summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--builtin.c2
-rw-r--r--tests/all.test5
2 files changed, 6 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index 8a809f51..6a1d7961 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<len; i+=3) {
uint32_t code = 0;
diff --git a/tests/all.test b/tests/all.test
index 171c8087..3b52ec90 100644
--- a/tests/all.test
+++ b/tests/all.test
@@ -71,6 +71,11 @@ null
"'<>&'\\''\"'"
"PD4mJyI="
+# regression test for #436
+@base64
+"foĆ³bar\n"
+"Zm/Ds2Jhcgo="
+
@uri
"\u03bc"
"%CE%BC"