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


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

<PRIVATE

: hex% ( n -- )
    CHAR: % , >hex >upper 2 CHAR: 0 pad-head % ;

: hex-utf8% ( ch -- )
    1string utf8 encode [ hex% ] each ;

: (url-encode) ( str quot: ( ch -- ? ) -- encoded )
