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 by Nathan

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

Nathan is a software developer at The Boeing Company in Charleston, SC. He is essentially a big programming nerd. Really, you could say that makes him a nerd among nerds. Aside from making software for the web, he plays with tech toys and likes to think about programming's big picture while speaking at conferences and generally impressing people with massive nerdiness and straight-faced sarcastic humor. Nathan got his programming start writing batch files in DOS. It should go without saying, but these thought and opinions have nothing to do with Boeing in any way.
This blog is also available as an RSS 2.0 feed. Click your heels together and click here to contact Nathan.