I’d recommend not trying to solve it on a case by case basis as there’ll always be another character that isn’t working. Generally, the trick is to ensure everything is Unicode.  

 

  1. use nvarchar fields instead of varchar (if it’s SQL Server)
  2. use cfqueryparam
  3. ensure Unicode is enabled in your datasource
  4. set the encoding of your scopes with <cfset setEncoding("URL", "UTF-8")><cfset setEncoding("FORM", "UTF-8")>
  5. specify your page encoding <cfcontent type = "text/html; charset=UTF-8">

 

Um… anything else?

 


Cabbage Tree Creative Ltd.
Matthew Walker 
web programmer
Phone    +64 3 377 7544
Email     [EMAIL PROTECTED]
Web      www.cabbagetree.co.nz

manage your own web site with Thrive - contact us to learn how!

 


From: [email protected] [mailto:[email protected]] On Behalf Of Ryan Sabir
Sent: Wednesday, 1 February 2006 7:01 p.m.
To: [email protected]
Subject: [cfaussie] Dealing with the &reg; symbol

 

Heya folks,

 

Does anyone have a good strategy for people who copy and paste text from wherever and include funny characters like the copyright symbol or the registered trademark symbol?

 

With the (r) symbol for example when it gets pasted into a text field and inserted into the database it comes out as two strange characters, I imagine that its a double byte ascii code thats getting munged up along the way. I tried doing a Replace on it in CF, and changing the (r) to an &reg; code, but the replace doesn't work properly and I'm left with a vertical pipe, followed by the (r) symbol.

 

Any ideas on this one?

 

bye!

 

 

Ryan Sabir
Technical Director

p: (02) 9274 8030
f: (02) 9274 8099
m: 0411 512 454
w: www.newgency.com

Newgency Pty Ltd
Web | Multimedia | eMarketing

224 Riley St
Surry Hills NSW 2010
Sydney, Australia

 

Reply via email to