Ben Parker wrote:
> I would recommend overriding .write() in your main servlet class, and 
> have that function compensate for the lack of a character set. For 
> example, you could change the function signature to be def 
> write(unicodeObject, charSet):, or you could have the write() function 
> accept either a string or both a unicode object and character set, or 
> reference an attribute on the servlet which specifies the charset to be 
> used with unicode objects, etc.

Do we want to offer something like this as the default? The encoding 
attribute could be set to a configurable (via Application.config) 
default such as 'utf-8', and could be used in other places as well. For 
instance, the Page class could write a content-type meta tag with the 
inherited attribute of HTTPContent in its writeMetaData method. And of 
course it could be overwritten by individual servlets.

I personally avoid using unicode in Webware; instead I write my servlets 
in latin-1 or utf-8, add a content-type tag to my base class and a 
"coding:" line at the top of my servlets, use the same encoding in the 
database and everythign fits together, with no unicode objects around.

But maybe if you get unicode content from other sources or want to 
switch between different encodings, using unicode will be an option.

Please give me your opinions since the next release is coming soon so it 
can be already included if we think it's useful.

-- Chris


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to