Copy link to clipboard
Copied
Hello Everyone
Spanish ASCII codes are not inserting properly into the database. I'm using microsoft SQL server 2014.
Spanish letters are changed automatically. For example Ñ changed into Á along with special character like ? or '.
Copy link to clipboard
Copied
Which version of ColdFusion are you using?
It shouldn't be required, but are you inserting the strings using NVARCHAR into a NVARCHAR column? (This would allow all UTF-8 characters and could be overkill.)
UPDATE myTable
SET SpanishText = <cfqueryparam value="Ñ" cfsqltype="cf_sql_nvarchar">
WHERE ID = 1;
When the insert is made, are you able to access the database directly and ensure that the value is correct? (It could be an issue when the data is being returned from the database and outputted to the page using the wrong character set.)
If you aren't sure that the values are explicitly Latin ASCII7, you could use Junidecode to ensure that they are using the correct character set. (Sometimes characters may appear to be Latin, but aren't. I've seen this happen with some Microsoft dashes and smart quote characters.)
https://dev.to/gamesover/convert-unicode-strings-to-ascii-with-coldfusion-junidecode-lhf