I am trying to read some data from an uploaded Excel file through ODBC.

I have the file uploaded properly, and the ODBC socket connection made.

But if i grab data and output, all of the Chinese characters are blown out.

My code is as follows:

<cfquery name="Test" datasource="DataSource">
    SELECT c_item, c_name
    FROM [tablename$]
</cfquery>

<cfoutput query="Test">
<p>#c_item# : #c_name#</p>
</cfoutput>

And the output is like:

40641S : ¶¶µo¤uµ{¦æ
40348H : ¬Ó©É¤uµ{¥ø·~¦³­­¤½¥q
40456J : ª÷©y¦¨¤ô¹qªA°È¦

I've tried meta content-type and cfcontent type, but no luck so far. I also tried to set connection string in CFAdmin "characterEncoding=UTF-8" no luck there either.

What am I missing? Any suggestions are appreciated.

Cheers.

You can determine if the problem is CF-related or DB Driver related by querying the ODBC datasource using a tool other then CF. If you the query comes through okay using another tool, then you know the problem is somewhere in CF.

Hope this helps you isolate the problem!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.