bsed / json-template

Automatically exported from code.google.com/p/json-template
0 stars 0 forks source link

Templates created using FromFile with unicode strings are broken #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Files are byte streams by definition, so textual data needs an encoding. 
FromString should probably either accept unicode() or str()

Original issue reported on code.google.com by gtempacc...@yahoo.com on 6 May 2009 at 6:13

GoogleCodeExporter commented 9 years ago
Yes, encoding should be explicitly handled, or explicitly dumped onto the user 
(caller).

Since properly handling character encoding is very troublesome, especially when 
you
mix in BOMs and HTML/XML, it probably should be treated as a separate feature 
set
(separate project even?) or greatly simplified.

Maybe FromFile() should simply be dropped, and let the user/caller handle the 
mapping
from a file to FromString().

Original comment by Robert.David.Williams on 14 May 2009 at 7:47

GoogleCodeExporter commented 9 years ago
It's worth considering dropping FromFile, but I'll see if I can just make it do
something reasonable.  This is Python-specific, and Python can handle unicode 
alright.

We would never sniff content, the encoding function param would just be 
authoritative.

Original comment by andyc...@gmail.com on 15 May 2009 at 5:07

GoogleCodeExporter commented 9 years ago

Original comment by andyc...@gmail.com on 15 May 2009 at 5:08

GoogleCodeExporter commented 9 years ago
Fixed by r281

Original comment by andyc...@gmail.com on 25 Sep 2009 at 5:14