[daisy] [JIRA] Created: (DSY-474) Rich text content doesn't transfer properly through the Java api (extended ascii)

Mike McLean (JIRA) issues at cocoondev.org
Wed May 23 11:06:20 CDT 2007


Rich text content doesn't transfer properly through the Java api (extended ascii)
---------------------------------------------------------------------------------

         Key: DSY-474
         URL: http://issues.cocoondev.org//browse/DSY-474
     Project: Daisy
        Type: Bug
  Components: Repository  
    Versions: 2.0.1    
 Reporter: Mike McLean
    Priority: Minor


To reproduce:

1) Starting from a new document type that includes a SimpleDocumentContent part type, create a new document (in my case, using a French variant) and enter extended ascii characters (i.e.: "Un numéro de carte de crédit"). Save and publish

2) From the Java api, get a handle on the part and create a string from the content:
String body = new String(part.getData());

OR 
 
InputStream in = part.getDataStream();
StringBuffer out = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
  out.append(new String(b, 0, n));
}

Both strings will yield the following: Un numéro de carte de crédit





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list