The Dopefly Tech Blog

<< The Dopefly Tech Blog Main page

Enabling Unicode for your CF DSN only helps your cfqueryparams

posted under category: ColdFusion on March 28, 2007 at 1:00 am by MrNate

Here's a tip - checking the Unicode checkbox in the CF Admin for your datasource only actually works when you have <cfqueryparam> for your variables.

Traditionally, col = '#content#' doesn't work to insert, say, Chinese characters unless you put an 'N' in front of the content: col = N'#content#'.

When you use <cfqueryparam> for your data, you lose the ability to place that 'N' in front, therefore, we have the checkbox, hidden under the advanced settings for your DSN, shown here:



When you check the box, you may expect it to universally work with all your nvarchar and ntext data everywhere, but it only works where you have implemented <cfqueryparam> tags for your content (which probably should be everywhere, anyway).

Too old to comment!
On Apr 4, 2007 at 1:00 AM O?uz Demirkap? (blog at the ever popular demirkapi.net) said:
Then use cfqueryparam :)

On Apr 4, 2007 at 1:00 AM O?uz Demirkap? (blog who dances with demirkapi.net) said:
... and fix your blog for Unicode support. :)

On Apr 5, 2007 at 1:00 AM Nathan Strutz (http://www.dopefly.com/) said:
Yeah, I'll do that as soon as I have an hour to goof off. At this rate, we're looking like may of 2021.
Too old to comment!