diff --git a/src/Tiny_httpd_util.ml b/src/Tiny_httpd_util.ml index 259dae2d..2e614c91 100644 --- a/src/Tiny_httpd_util.ml +++ b/src/Tiny_httpd_util.ml @@ -18,6 +18,8 @@ let percent_encode ?(skip=fun _->false) s = | ',' | '/' | ':' | ';' | '=' | '?' | '@' | '[' | ']' | '~') as c -> Printf.bprintf buf "%%%X" (Char.code c) + | c when Char.code c > 127 -> + Printf.bprintf buf "%%%X" (Char.code c) | c -> Buffer.add_char buf c) s; Buffer.contents buf