@@ -66,20 +66,20 @@ feature -- Percent encoding
6666 end
6767 end
6868
69- partial_encoded_string (s : READABLE_STRING_GENERAL ; a_ignore : ITERABLE [CHARACTER_ 32 ]): STRING_ 8
69+ partial_encoded_string (s : READABLE_STRING_GENERAL ; a_ignore : ITERABLE [CHARACTER ]): STRING_ 8
7070 -- Return `s' as percent-encoded value,
7171 -- but does not escape character listed in `a_ignore'.
7272 do
7373 create Result .make (s .count )
7474 append_partial_percent_encoded_string_to (s , Result , a_ignore )
7575 end
7676
77- append_partial_percent_encoded_string_to (s : READABLE_STRING_GENERAL ; a_result : STRING_GENERAL ; a_ignore : ITERABLE [CHARACTER_ 32 ])
77+ append_partial_percent_encoded_string_to (s : READABLE_STRING_GENERAL ; a_result : STRING_GENERAL ; a_ignore : ITERABLE [CHARACTER ])
7878 -- Append `s' as percent-encoded value to `a_result',
7979 -- but does not escape character listed in `a_ignore'.
8080 local
8181 c : NATURAL_ 32
82- ch : CHARACTER_ 32
82+ ch : CHARACTER_ 8
8383 i ,n : INTEGER
8484 do
8585 has_error := False
@@ -109,15 +109,21 @@ feature -- Percent encoding
109109 43 , 44 , 59 , 61 , -- reserved = sub-delims: +,;=
110110 37 -- percent encoding: %
111111 then
112- ch := c .to_character_ 32
112+ check c .is_valid_character_ 8 _code end
113+ ch := c .to_character_ 8
113114 if across a_ignore as ic some ic .item = ch end then
114115 a_result .append_code (c )
115116 else
116117 append_percent_encoded_character_code_to (c , a_result )
117118 end
118119 else
119- if across a_ignore as ic some ic .item = ch end then
120- a_result .append_code (c )
120+ if c .is_valid_character_ 8 _code then
121+ ch := c .to_character_ 8
122+ if across a_ignore as ic some ic .item = ch end then
123+ a_result .append_code (c )
124+ else
125+ append_percent_encoded_character_code_to (c , a_result )
126+ end
121127 else
122128 append_percent_encoded_character_code_to (c , a_result )
123129 end
0 commit comments