Skip to main content
thorstens95795930
Participant
August 23, 2016
Answered

CFML query update database poland character

  • August 23, 2016
  • 1 reply
  • 1340 views

Hi All,

if i update my database mysql, the character not correct update in the database:

update mitarbeiter

set vorname = 'Gdańsk'

where id = '1604'

In the database stand: Gda?sk

The character encoding on the site seems ok.

in HTML it shows:

Gdańsk

does anybody knows the problem ?

thanks

thorsten

This topic has been closed for replies.
Correct answer thorstens95795930

Are you using cfqueryparam? Is the field data type nvarchar? You can also check to see if the string format option is ticked in the datasource setup in CF admin.

String Format - Enable High ASCII characters and Unicode for data sources configured for non-Latin characters

Also is your sql db charset UTF8?

Also see ColdFusion - Inserting arabic/persian characters to mysql - Stack Overflow


Hi,

i have solved the problem on visitenkarten.com

the solution is very simple.

in the coldfusion administrator i insert the connection string in the database:

useUnicode=true&characterEncoding=utf8

in the database fields it is important that the fields are

character set: utf8

and  the collation: utf8_gereral_ci

now it works.

greetings thorsten

1 reply

WolfShade
Legend
August 23, 2016

If you are going to use characters like that, you need to change the datatype of the column.  I'm assuming you set it for varchar; change it to nvarchar, re-do the update and see if that fixes it.

HTH,

^_^

thorstens95795930
Participant
August 23, 2016

Hi,

if i insert it on command line.

the characters are correct.

only if i insert it via web site..

the characters are damaged.

WolfShade
Legend
August 23, 2016

If you are getting the erroneous character replacement by submitting it via a web page, browsers are (by default) set for UTF-8 encoding.

http://dba.stackexchange.com/questions/140018/special-characters-in-mysql-using-utf8-unicode-collation-and-load-data-infile

HTH,

^_^