[Rails-spinoffs] Re: How to deal with Unicode chars inside X-JSON HTTP header (besides UCS)?

2006-09-20 Thread Martin Bialasinski

I am sorry, I did not understand you correctly. And I also have to
revise my understanding of the matter.

RFC2616, Section 2.2 says:

The TEXT rule is only used for descriptive field contents and values
that are not intended to be interpreted by the message parser. Words
of *TEXT MAY contain characters from character sets other than ISO-
8859-1 [22] only when encoded according to the rules of RFC 2047 [14].
   TEXT   = any OCTET except CTLs,
but including LWS

What seems to happen is that Firefox assumes the X-JSON header to
contain a ISO-8859-1 encoded value and performs a conversion
ISO-8859-1 - UTF8. So multi-byte codepoint don't work.

I tried quoted printable but had no luck, but it might be just me. And
there is also the question how the various browsers handle this.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Spinoffs group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~--~~~~--~~--~--~---



[Rails-spinoffs] Re: How to deal with Unicode chars inside X-JSON HTTP header (besides UCS)?

2006-09-20 Thread Marius Feraru

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

 Your tests show that IE6 correctly retrieves a UTF-8 encoded header? 
 Then it should wrongly decode the ISO-8859-1 equivalent value in the 
 X-JSON-UCS header as either C3 9F or DF can be ß, but not both, no?
When I said UCS encoded, I really meant that :))

Remember this scrap from Gecko debug:
- -1210520688[9c18b48]: http response [
- -1210520688[9c18b48]:   HTTP/1.1 200 OK
...
- -1210520688[9c18b48]:   X-JSON-UCS: {a:\u00df,_:,b:\u00e7}
- -1210520688[9c18b48]:   X-JSON: {a:ß,_:,b:ç}
...
- -1210520688[9c18b48]: ]
These are raw headers, it's exactly what it received.

 Sending the ß character X-JSON (utf-8 encoded value) = C3 9F 
 X-JSON-UCS (equals ISO-8859-1 in this case) = DF
^ no, it's 6 (six) bytes: \, u, 0, 0, d and f.

Following your thoughts, looks like IE doesn't assume data is ISO-8859-1
(or anything else), it just passed on the raw header to JS.

- --
Marius Feraru
-BEGIN PGP SIGNATURE-

iD8DBQFFEcTFtZHp/AYZiNkRAvvNAJ91DBqJpn80XdiSZk+jui3ZeeE2ZACeM2qn
IXo+AiA/+0nunMc/Zy0b6pY=
=voBd
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Spinoffs group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~--~~~~--~~--~--~---