>
> This totally makes sense, thank you.
> Hum... cpdetector is half a megabyte, a wee bit too large.
>

Yes, I know.


> However, the xml declaration is just one line, and I believe that one can
> be read before reading the actual content.
> Actually, see this one, it seems a parser can read the encoding if given
> the right type of input:
>
> http://stackoverflow.com/questions/3482494/howto-let-the-sax-parser-determine-the-encoding-from-the-xml-declaration
>

Fine, I think that makes the InputSource use the specified encoding to
build an internal reader.
The only caveat I found with this approach is that sometimes the declared
xml encoding cannot correspond to the the real file encoding, but I think
we can ignore this.
Another thought: this is surely the way to go for xml files (like SLD). For
different type of file files (like freemarker templates) we should use
other techniques. Will investigate on that.

Mauro

-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to