Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Ace-t #1
How to extract multilingual to MS Excel
How can I extract multilingual data into MS Excel application. At the moment
the data extracted into Excel file is not readable. Currently using CFMX with
the following code to export data to MS Excel;
<cfcontent type="application/msexcel">
<cfheader name="Content-Disposition" value="filename=report.xls">
What extra coding need to add to set the multilanguage to be readable in MS
Excel? (On the website it displays the characters fine)
Ace-t Guest
-
Multilingual Solution
One of our customer's sites is about to go down the path of offering up 5-6 additional languages for all content. We have a DB solution for the... -
extract record from database to notepad or excel
Hi.. Have anyone can help me how to extract data from my db to notepad or excel..? is there any tools in Dw to do this? -
Extract Data from Excel-files
Hello everyone, Finally I get to use perl at work! =) I am to facing the following problem: There is a folder on a file-server in our network... -
Fixed Length Text Extract, Write to Excel
Hello All, I am trying to work with the code I have to extract fields from a text file report, and write the values into excel. I am having... -
Is PHP able to extract data out of an Excel spreadsheet?
The only form of database we use is an Excel database. Otherwise is it possible to import the relevant spreadsheet data into say MySQL? Perhaps it... -
PaulH #2
Re: How to extract multilingual to MS Excel
define "unreadable"? what encoding is your data, your cf page, etc.?
PaulH Guest
-
Ace-t #3
Re: How to extract multilingual to MS Excel
Hi Paul,
When extracted to MS Excel from CF the character comes out as question marks.
The chinese data is from a query to a SQL Server table.
I am using the following encoding for the chinese character sets.
<!--- Setting up right encoding --->
<cfset URLenChar = "UTF-8" >
<!--- Set encoding to UTF-8. --->
<cfset setEncoding("URL", "UTF-8")>
<cfset setEncoding("Form", "UTF-8")>
<!--- Set the output encoding to UTF-8 --->
<cfcontent type="text/html; charset=UTF-8" reset ="No">
<!--}}}-->
<!--- Use the request to get the client's prefered locale --->
<!--{{{ -->
<cfset localize = getPageContext().getRequest().GetLocale()>
<cfif not isDefined("localize")>
<!--- then use the default locale of the system we're running on --->
<cfset request.locale = createObject("java",
"java.util.Locale").getDefault().getLanguage() >
<cfelse>
<cfset request.locale = localize.getLanguage()>
</cfif>
This code does work when it is used to display the chinese characters on the
website as mentioned, however when I invoke MS Excel apllication (with the
codes from the first msg) the data in the comes out as question marks. In
short, the simple CF page just contains the above encoding for the character
set and a query to SQL table to retrieve the data. What code do I need to add
to extract the character set correctly into MS Excel?
Ace-t Guest
-
PaulH #4
Re: How to extract multilingual to MS Excel
question marks are bad, it means the data is corrupted. and fyi, boxs aren't so bad, it means the browser/whatever can't render that char.
i'll see what i can reproduce.
PaulH Guest
-
PaulH #5
Re: How to extract multilingual to MS Excel
it looks like excel doesn't like utf-8 encoding. even when i simply dumped out
utf-8 to a CSV file and tried importing it, the excel text was mojibake. it
seems to only work with utf-16/unicode (little endian). further evidence
assuming google ads knows what it's doing, it downloads ad sense/etc CSV
reports as unicode (utf-16) encoding.
googling though turns up conflicting info (some references say it can use
utf-8 others say it can). there also seems to be a way via XML but i think that
only works for excel 2003 and better.
need to dig a bit more.
PaulH Guest
-
Ace-t #6
Re: How to extract multilingual to MS Excel
Hi Paul,
Thanks for the feedback, I do hope you will find a method as I don't have any ideas!
Tom
Ace-t Guest
-
PaulH #7
Re: How to extract multilingual to MS Excel
right now the cheapest solution seems to be to cast your data/page encoding to
utf-16. another approach might be thru 3rd party tools like
[url]http://jakarta.apache.org/poi/[/url][/L (the POI-HSSF bits). though these maybe
overkill.
PaulH Guest



Reply With Quote

