How to extract multilingual to MS Excel

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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?
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default Re: How to extract multilingual to MS Excel

    define "unreadable"? what encoding is your data, your cf page, etc.?

    PaulH Guest

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139