From: David L. <dle...@co...> - 2008-08-26 22:14:15
|
On 26-Aug-08, at 4:38 PM, David LeBer wrote: > Now, I'm sure this is all my fault somehow... > > I'm upgrading an old D2W project to UTF-8, I've updated the database > and set the defaultencoding in the Wonder properties: > > er.extensions.ERXApplication.DefaultEncoding=UTF-8 > er.extensions.ERXMessageEncoding.Enabled=true > > And the web portion of the app seems to be working swimingly. > However, I've got a couple of reports that are exported using > ExcelLook and they get messed up when using UTF-8. > > Latin 1: > > <Picture 15.png> > > > UTF-8: > > <Picture 16.png> > > > It looks like it's mostly the Excel cell definitions that are > getting munged. Can someone confirm that ExcelLook and > ExcelGenerator work OK with UTF-8 (I understand that POI should be > fine)? > > Or if there is a switch I need to through that I'm not? Hrm, weird. If I modify append to response in EGWrapper to write the data out to a file, and open that it works fine. When it appends the data to the response and returns that, excel doesn't recognize it. This is the EGWrapper code: EGSimpleTableParser parser = new EGSimpleTableParser(stream, fonts(), styles()); NSData data = parser.data(); // I added this and the resulting file opens fine try { File theFile = new File("/Users/david/Desktop/test.xls"); FileOutputStream fileStream = new FileOutputStream(theFile); data.writeToStream(fileStream); } catch (Exception e) { e.printStackTrace(); // I hope Chuck isn't reading this... } // end if((hasBinding("data") && canSetValueForBinding("data")) || (hasBinding("stream") && canSetValueForBinding("stream")) ) { // WE BYPASS THIS ... } else { response.appendContentData(data); String fileName = fileName(); if(fileName == null) { fileName = "results.xls"; } response.setHeader("inline; filename=\"" + fileName + "\"", "content-disposition"); response.setHeader("application/vnd.ms-excel", "content-type"); } WO 5.3.3 Wonder as of 5 minutes ago. ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile: http://www.linkedin.com/in/davidleber twitter: http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile: http://www.linkedin.com/in/davidleber twitter: http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org |