Skip to main content
April 6, 2010
Answered

Insert Arabic Characters into mysql Database

  • April 6, 2010
  • 3 replies
  • 6359 views

I'm trying to insert Arabic character from coldfuin 7 into mysql 4.1 DB the DB collation is utf8_unicode-ci

The form is in utf-8 enicoding.

When I use the php mysql admin and try to inset Arabic it works fine but when I use coldfusion I get ??????????

Any idea?

Thank you

This topic has been closed for replies.
Correct answer tooMuchTrouble

assuming that the db is correctly setup for unicode and that you're using JDBC

driver (not ODBC) then:

add

useUnicode=true&characterEncoding=utf8

to the connection string box (not exactly sure what is was called in cf7) found

in teh advanced menu for that DSN.

3 replies

Participant
March 16, 2011

Hello, I have a similar problem but i am using a java application. And  also the arabic text in Mysql and in java application is readable, but i  can only write arabic text in mysql. if i update the fields and write  arabic text from the java application it changes into ???? even in the original database. can anyone help me with this.

Inspiring
March 16, 2011

And did you to all the things suggested in this thread?  After doing that, did you still have problems?

--

Adam

Participant
March 17, 2011

Yes i did. I have made the encoding of the database to utf 8 , and everything is ok in the database, but in the java application i can only view arabic data but not write.

Inspiring
April 7, 2010

and since email replies won't work with the "<>" chars in them:

in application.cfm

<cfset setEncoding("url","UTF-8")>

<cfset setEncoding("form","UTF-8")>

<cfcontent type="text/html; charset=UTF-8">

at the top of your cf pages add:

<cfprocessingdirective pageEncoding="UTF-8">

tooMuchTroubleCorrect answer
Inspiring
April 7, 2010

assuming that the db is correctly setup for unicode and that you're using JDBC

driver (not ODBC) then:

add

useUnicode=true&characterEncoding=utf8

to the connection string box (not exactly sure what is was called in cf7) found

in teh advanced menu for that DSN.

May 4, 2010

is it possible to add connection string to CF code rather than CF admin? I moved to a new hosting company hostek and the helm does not support advanced options when setting CF DSN.

Thank you,

Inspiring
March 16, 2011

Not easily, no.  Just drop your provider's support bods a line, and ask them to add it!

--

Adam