I have also encountered this issue. Mark, per your recommendation, I have attempted to modify BitstreamReader.
I did not see a place to set encoding apart from the mime type.
this.bitstreamMimeType = bitstream.getFormat().getMIMEType();
if (bitstreamMimeType.equals("text/html")) {
bitstreamMimeType = "text/html; charset=UTF-8";
}
this.bitstreamName = bitstream.getName();
Based on a couple quick tests, this looks promising.
Is this what you were recommending?
Terry
---------- Forwarded message ----------
From: Mark H. Wood <[email protected]>
Date: Thu, Jul 25, 2013 at 9:54 AM
Subject: Re: [Dspace-tech] text encoding problem with bitstreams in DSpace
3.1 - resolved
To: [email protected]
On Thu, Jul 25, 2013 at 03:07:36AM +0000, Halliday, James Leonard wrote:
> Hi everyone,
>
> I posted about this a while back, and finally found a workaround so I
wanted to share. My problem was regarding HTML bitstreams in DSpace 3.1
(XMLUI).
>
> In previous versions of DSpace, the encoding for my UTF-8 bitstreams
worked just fine, but in DSpace 3.1, the encoding for ONLY the bitstreams
was coming out as ISO-8859 instead. After much searching, I finally found a
workaround which involved changing a value in the web.xml file, as follows:
>
> In the original web.xml are the following lines:
>
> <filter>
> <filter-name>SetCharacterEncoding</filter-name>
>
<filter-class>org.dspace.app.xmlui.cocoon.SetCharacterEncodingFilter</filter-class>
> <init-param>
> <param-name>encoding</param-name>
> <param-value>UTF-8</param-value>
> </init-param>
> </filter>
>
> I substituted:
>
> <filter>
> <filter-name>SetCharacterEncoding</filter-name>
>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
> <init-param>
> <param-name>encoding</param-name>
> <param-value>UTF-8</param-value>
> </init-param>
> <init-param>
> <param-name>forceEncoding</param-name>
> <param-value>true</param-value>
> </init-param>
> </filter>
>
> So basically I took out the DSpace-specific encoding filter, and
substituted the Spring one (which is already included by default). So I had
to change only these lines, and my encoding problem was resolved. This
tells me there might be a problem in the DSpace encoding filter ... ?
Thank you. Interesting. If this works well, then at the least we
could just use Spring's filter and stop maintaining our own.
I'm thinking that our filter as written could never have done what you
expect, and the effect was produced elsewhere. Our filter only sets
the request's encoding. Spring's filter is documented to also set the
response's encoding when forceEncoding=true. Perhaps BitstreamReader
should just set the encoding on the response?
--
Mark H. Wood, Lead System Programmer [email protected]
Machines should not be friendly. Machines should be obedient.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette:
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
--
Terry Brady
Applications Programmer Analyst
Lauinger Information Technology
202-687-7053
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________ DSpace-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

