 
 : encode-uri ( str -- str' )
     [
-        [ dup escape-uri-char? [ push-utf8 ] [ , ] if ] each
+        [ dup escape-uri-char? [ hex-utf8% ] [ , ] if ] each
     ] "" make ;
 
 <PRIVATE

            '[ dup @ [ , ] [ hex% ] if ] each
        ] [
            [ present ] dip
            '[ dup @ [ , ] [ push-utf8 ] if ] each
        ] if
    ] "" make ; inline


        2dup length >= [
            2drop
        ] [
            2dup nth-unsafe dup CHAR: % = [
                drop 2dup _ decode-uri-hex [ 3 + ] dip
            ] [
                utf8% [ 1 + ] dip
            ] if _ decode-uri-iter
        ] if
    ] call ; inline recursive
