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

Spanish ASCII codes are not inserted properly in the database.

New Here ,
Jul 08, 2022 Jul 08, 2022

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 '. 

Views

143

Translate

Translate

Report

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 ,
Jul 08, 2022 Jul 08, 2022

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Documentation