Updated encoder library, especially URL encoders to reuse implementation of percent_encoder.e

Fixed JSON_ENCODER for %T and related.
Updated related autotest cases.
This commit is contained in:
2014-04-09 18:10:51 +02:00
parent 9999b5e400
commit d40131f863
6 changed files with 62 additions and 407 deletions

View File

@@ -50,8 +50,11 @@ feature -- Encoder
inspect c
when '%"' then Result.append_string ("\%"")
when '\' then Result.append_string ("\\")
when '%R' then Result.append_string ("\r")
when '%B' then Result.append_string ("\b")
when '%F' then Result.append_string ("\f")
when '%N' then Result.append_string ("\n")
when '%R' then Result.append_string ("\r")
when '%T' then Result.append_string ("\t")
else
Result.extend (c)
end
@@ -103,12 +106,21 @@ feature -- Decoder
when '%"' then
Result.append_character ('%"')
i := i + 2
when 'b' then
Result.append_character ('%B')
i := i + 2
when 'f' then
Result.append_character ('%F')
i := i + 2
when 'n' then
Result.append_character ('%N')
i := i + 2
when 'r' then
Result.append_character ('%R')
i := i + 2
when 't' then
Result.append_character ('%T')
i := i + 2
when 'u' then
hex := v.substring (i+2, i+2+4 - 1)
if hex.count = 4 then
@@ -170,7 +182,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2012, Eiffel Software and others"
copyright: "Copyright (c) 2011-2014, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software