manar droubi wrote:
> 
> i'm using Apache, MySql 4.0.24-nt, Coldfusion MX 6.1, on Windows XP Pro sp2

You should use MySQL 4.1 or newer when you work with Unicode.


> i used <cfcontent type="text/html; charset=utf-8">
> and <cfprocessingDirective pageencoding="utf-8">
> and <cfset setEncoding("form","utf-8")>
> 
> i have aslo added the following string to my DSN name in Coldfusion
> administrtor:
> useUnicode=ture&characterEncoding=UTF-8

>   <cfquery datasource="ams_test">
>     INSERT INTO tbl_questions (Q_ID, Q_Mark, Q_Text)
>     VALUES ('#Q_ID#', '#FORM.select#', '#FORM.txt_text#')
>   </cfquery>

Use cfqueryparam:
<cfquery datasource="ams_test">
   INSERT INTO tbl_questions (Q_ID, Q_Mark, Q_Text)
   VALUES (
        <cfqueryparam value="#Q_ID#">,
        <cfqueryparam value="#FORM.select#">,
        <cfqueryparam value="#FORM.txt_text">
        )
</cfquery>


> Syntax error or access violation: You have an error in your SQL syntax.
> Check the manual that corresponds to your MySQL server version for the right
> syntax to use near '1 'D/1H(J')' at line 2
> 
> although it is generating a correct sql statement:
> 
> SQL    INSERT INTO tbl_questions (Q_ID, Q_Mark, Q_Text) VALUES
> ('C0260AA0-A481-DF60-26BA5C0DEFEDF160', '1', 'منار الدروبي')

Some Arabic UTF-8 characters are represented by a bytestring that 
contains a '. IIRC that will work when you use cfqueryparam and 
MySQL 4.1.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238468
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to