|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
CF and latin1 character sets
Does anybody know how to make ColdFusion use the latin1 character set? We're trying to get Flash and MySQL talking to each other using ColdFusion and it keeps messing up the non-english characters. From what I've read, it uses UTF8 by default, however that's not supported by MySQL right now. I think it will be in 4.1, however everything I've seen suggests that it's broken. Using a cfcontent type may not work since we're planning on using cfc's.
__________________
blockcipher --------------- Gratuitously stolen... mysql> SELECT * FROM user WHERE clue > 0; 0 Results Returned. PHP5/MySQL/UTF-8 My Tech Blog |
|
#2
|
|||
|
|||
|
You can do different character sets in ColdFusion MX by placing:
<cfprocessingdirective pageencoding="UTF-8"> at the top of whatever page you want to handle UTF encoding. |
|
#3
|
|||
|
|||
|
Well, that didn't help. I tried it in every file that I could be it a cfc or a regular cfm and nothing helped. When I look at a cfm file, Firebird still thinks it's UTF-8. Is there any way to put UTF-8 data in MySQL and have ColdFusion read it back as UTF-8? I tried a few things like using a blob instead of text, but that only caused problems.
|
|
#4
|
|||
|
|||
|
My bad, I didn't see that CF is only pulling the data from MySQL and forwarding it to Flash. Yes, this is definitely a MySQL issue, not a ColdFusion one. I believe you are right that the current version of MySQL does not support UTF encoding. There's nothing that CF can do about it, it can only use what's in the database. For sure if you are using ColdFusion MX it supports UTF encoded characters, so until you can get the data in and out of MySQL in the right format there's nothing that can be done other than switching databases of course. Maybe Postgre?
|
|
#5
|
|||
|
|||
|
Damn...that was not the answer I was hoping for. As for alternatives, we're locked in to MySQL by our customer's support contractor. I do thank you for your time.
|
|
#6
|
|||
|
|||
|
It will work, but you can't use ODBC use JDBC instead.
You can make the page you want to work work. You just have to use JDBC instead of ODBC. Setup a folder and place the JConnector java jar files into the directory. Next update your Java classpath from the Cold fusion interface to include the 3 jars. 2 from lib and the 1 mysql jar. Next, restart your cold fusion server. Now, go to setup a connection. You will put in your usual options then you will have to put this in the connectionstring section.....
for example: replace below values with your respective values..... Database=test Server=192.168.1.10 username=someuser password=somepassword Under Advanced Settings ConnectionString= jdbc:mysql://192.168.1.10/test?user=someuser&password=somepassword&useUnicode=true&characterEncoding=latin1 That should do the trick. It's pretty simple just read carefully. Java supports unicode natively, so of course the java drivers can support it. The problem was the C API's in the ODBC driver. The next ODBC driver should have Uni support so they say, but who knows. Good luck, this setup is working fine for me. Wade |
|
#7
|
|||
|
|||
|
MySQL and Unicode.
Yes MYSQL itself supports unicode. You can manipulate the date using MyCC and can put in an character you want and get them back out as they were entered. MyCC uses mysql api's though. The odbc driver is a little less useful however. Just thought you might like to be informed that MySQL itself supports unicode fine.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CF and latin1 character sets |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|