Added general_encoded_string (..) that accepts READABLE_STRING_GENERAL

This commit is contained in:
Jocelyn Fiat
2012-09-11 20:52:24 +02:00
parent 795f82d51f
commit 0f59535696
2 changed files with 34 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ inherit
redefine
default_create,
name,
general_encoded_string,
encoded_string, partial_encoded_string,
decoded_string
end
@@ -49,7 +50,17 @@ feature -- Encoder
Result := Precursor (Result)
end
partial_encoded_string (s: READABLE_STRING_32; a_ignore: ARRAY [CHARACTER]): READABLE_STRING_8
general_encoded_string (s: READABLE_STRING_GENERAL): STRING_8
do
if attached {READABLE_STRING_32} s as s32 then
Result := utf32_to_utf8 (s32)
else
Result := s.as_string_8
end
Result := Precursor (Result)
end
partial_encoded_string (s: READABLE_STRING_GENERAL; a_ignore: ARRAY [CHARACTER]): STRING_8
-- URL-encoded value of `s'.
do
Result := Precursor (s, a_ignore)