Changing ColdFusion Builder file encoding

Thursday, April 1, 2010

A few of our source code files contain Spanish text strings and smart quotes (i.e. curly quotes) copied from MSWord and pasted into Eclipse. These “special characters” have never caused problems in CFEclipse, but they were showing up as little boxes in CFBuilder:


I knew it was a file encoding issue but couldn’t solve it. The default text file encoding (window – preferences – general – workspace -– Text file encoding) was Cp1252, which was the same as CFE. However, viewing the properties of a file showed that the file was UTF-8 in CFBuilder but still Cp1252 in CFEclipse.

To get CFBuilder to behave like CFEclipse with respect to file encoding:

  1. Window – preferences – general – Content Types
  2. Expand the “Text” tree
  3. Select “CFML Source File”
  4. Down at the bottom, change the Default encoding


Warning: I wouldn’t change this setting unless you’re experiencing this problem yourself. To be clear, this falls into the “if you must do dumbass stuff like copy text from Word into Eclipse and retain the funky characters, then here’s how to fix it”


Aaron Greenlee said...

Thank you! I have been having a hard time since CFBuilder does not change encoding the way native Eclipse does.

I appreciate this tip.

Marc Esher said...

You're very welcome.

SwissMade said...

But it says it is loeckd. The *.cfm.
*cfm (locked).
How can i fix it?

Marc Esher said...

@SwissMade, simply type in the new encoding in the box and the "Update" button will become enabled