encoding newlines in attribute values
Marius Scurtescu
marius at sxip.com
Thu Apr 19 06:57:20 UTC 2007
On Wed, 2007-18-04 at 23:25 -0700, Douglas Otis wrote:
> On Apr 18, 2007, at 8:31 PM, Marius Scurtescu wrote:
>
> > Base64 encoding is a pretty good candidate for binary data, but you
> > cannot apply the same encoding to text fields.
>
> RFC4648 "URL and Filename safe" Base 64 Alphabet might be a good choice.
>
> > Applying base64, or similar encoding appropriate for binary data, to
> > text fields has two drawbacks:
> > - renders the field unreadable
>
> Binary data is often unreadable.
True, but text is readable and ideally it should stay like that.
>
> > - increases the size of the field
>
> Base 64 increases the size of the encoded element by about 30%.
>
> > URL-encoding has the advantage that probably all web frameworks will
> > have functions to encode and decode this format.
>
> URL-encoding increases the size of the encoded element by 300%.
Only unsafe characters are encoded, not the whole string.
Not sure how UTF-8 changes any of this.
Marius
More information about the specs
mailing list