askxuefeng wrote:
> But how to resolve html files with utf-8 and iso-8859-1? I mean, some files
> have utf-8 encoding, and some is iso-8859-1, and even more. 
I don't think Resin offers a clever way of doing that, but you could
probably implement a filter.  The filter could for example buffer the
first few lines of the response, inspect the META tag for content type
and set that content type on the response.  That will of course only
work for HTML files with a META tag for the Content-Type.  Other
strategies could be used as well, such as looking for the
redundant/optional UTF-8 byte order mark (BOM) at the beginning of the
file.  Scanning the entire file for known byte encodings of common
characters may also work as circumstantial evidence for a text file's
character set.


resin-interest mailing list

Reply via email to