coldfusion


Using ColdFusion to show Chinese Characters from AS/400 server


I am writing a ColdFusion program that uses cfquery to get data from an AS/400 iSeries table and then output that data to a web page. Some times the Data is in Chinese, but it does not output the Chinese characters correctly.
I built the query below for testing,
<cfprocessingdirective pageEncoding="UTF-8" />
<cfquery name="Test" Datasource = "AS400">
select dsc1 from sales where ref = '123456'
</cfquery>
<cfoutput>#test.dsc1#</cfoutput>
The result should be "M5方头螺栓" but I only get "M5". I did another test running just:
<cfset x = "M5方头螺栓"/>
<cfoutput>#x#</cfoutput>
and it displays the Chinese no problem.
Since ColdFusion can display the characters when they are written out in the code, but not when it goes to get the data through SQL, it seems like the issue is with either my ODBC settings or my ColdFusion Server Data Source Settings but I'm not familiar enough with these settings to know what needs to be changed to get this working.
You've already proven that CF can output UTF-8 characters correctly. Have you tried running that query in the DB console or UI? Do you get the correct charaters?
If the characters were stored as VARCHAR and not NVARCHAR, then there's nothing you can do. The data has to have been properly stored in the first place.
If the characters are stored correctly in the DB, try adding <cfprocessingdirective pageEncoding="utf-8"> at the top of the request. CF should be using UTF-8 by defualt, but this will force the correct character set if, for some reason, it isn't.

Related Links

Issue with PUT request in ColdFusion 10
understanding the behaviour of cfflush
variable/function declaration in coldfusion
How to ensure a cfobject variable is local to a function?
Looping over the query results set
Are file name comments dangerous?
not properly displaying the Bar chart using coldFusion
This is weird issue I am geting while doing Query of Query
The request has exceeded the allowable time limit Tag: cfhttp
Retrieve email and phone number via Google API
How to call a function in coldfusion [closed]
System configuration file in ColdFusion
WireBox: Map a Java class and immeriately call a method
How to pass parameters in cfhttp for put requests in coldfusion?
Scan all files in a directory and return counts by file type
Why aren't my files showing? Using Amazon S3 with ColdFusion

Categories

HOME
datatables
phpunit
ruby-on-rails-4
sql-server-2005
mongoose
mono
windows-installer
terraform
delay
spf
pivot-table
openmeetings
slim
flannel
ccache
shoutem
stormcrawler
category
fix
react-boilerplate
zillow
bootstrap-select
ajaxform
google-nativeclient
qtspim
unimrcp
indexof
oracle-data-integrator
messagebox
interceptor
ext4
data-migration
bing-api
ireport
nestedscrollview
submenu
r6
regedit
android-auto
google-console-developer
sqlitestudio
gitversion
live-connect-sdk
r.js
leap-motion
ch
git-stash
strstream
deferred-loading
correspondence-analysis
singularitygs
nameerror
apache-commons
angularjs-ng-options
certificatestore
soundex
seeding
ngen
google-text-to-speech
worksite-sdk
srv
comfortable-mexican-sofa
stacked-area-chart
worklight-server
out
pyro
maptiler
usermode
complete.ly
resourcedictionary
yepnope
facebook-app-center
node-http-proxy
rs485
backbone-forms
customvalidator
in-app
codeigniter-datamapper
endl
mindmapping
iasyncresult
background-music
windows-2000
tibco-gi
maintenance-plan

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App