Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insert Arabic Characters into mysql Database

Guest
Apr 06, 2010 Apr 06, 2010

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

TOPICS
Database access
6.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Apr 06, 2010 Apr 06, 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.

Translate
Enthusiast ,
Apr 06, 2010 Apr 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 03, 2010 May 03, 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,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2011 Mar 16, 2011

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

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 06, 2010 Apr 06, 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">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2011 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2011 Mar 16, 2011

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

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2011 Mar 16, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 17, 2011 Mar 17, 2011
LATEST

OK, so you're passing the useUnicode thing in the JDBC string for your CF data source.  Are you doing the same thing when you make your JDBC connection with Java?

It's probably more sensible to ask Java-specific questions on a Java forum, btw.  This is a CF forum, and few CF developers have this sort of exposure to Java.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources