String enc = JetspeedResources.getString(JetspeedResources.CONTENT_ENCODING_KEY,"US-ASCII");
CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( req.getHeader("User-Agent") );
String mimeCode = cm.getPreferredType().getCode();
if ( mimeCode != null )
{
MediaTypeEntry media = (MediaTypeEntry)Registry.getEntry(Registry.MEDIA_TYPE, mimeCode);
if ( media != null && media.getCharacterSet() != null)
{
enc = media.getCharacterSet();
}
}
if ( req.getCharacterEncoding() != null )
{