Re: uriGetter encoding
Kevin Reid <kpreid-M/[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Jun 28, 2010, at 6:12, Thomas Leonard wrote:
> Well, I like it. I've used separate types for encoding strings before
> and it works well to prevent subtle escaping bugs. I assume there
> would
> be a guard for methods that need an encoded string? e.g.
>
> ? def encoded := "a b" :URIFragment
> # value: URIFragment("a%20b")
>
> ? encoded :String
> # value: "a b"
>
> I was a bit worried about backwards compatibility, but maybe the
> coercion fixes that. Or, we could use the syntax version to turn it
> on.
> Coercing to a String and back would be slightly lossy (using your
> example of %26 = "&"). Is that OK?
No, it would be merely a label: coercion to a String would preserve
the characters.
--
Kevin Reid <http://switchb.org/kpreid/>