Why won't certain characters be typed correctly by SQL Server from CFQUERY?

I have a Coldfusion application running on Lucee that connects to a SQL Server database.

When I run the following query directly in SQL Server Manager:

UPDATE article
SET content='20m²'
WHERE id=3159

      

The column is filled with a penalty of 20 m².

HOWEVER, when run from a cfml page that just runs this:

  UPDATE SET content = '20m²' WHERE id = 3159

Column filled in: 20 m²

As is the case, this additional symbol appears. This also happens with some other special characters, but most of them are fine. Is it related to some jdbc connector configuration? I don't understand what is the difference between these two? Putting a value in the cfqueryparam tag doesn't matter.

thank

+3


source to share


1 answer


If this is hardcoded, I believe you will need to save this file in Unicode UTF-8.

enter image description here



Also make sure your JVM arguments will handle this as well. Admin> Server Settings> Java & JVM. Add "-Dfile.encoding = UTF-8" to Arguments.

enter image description here

+3


source







All Articles