Skip to main content
Inspiring
March 18, 2008
Question

Using cffile to make a unicode textfile

  • March 18, 2008
  • 1 reply
  • 679 views
Hi, I am trying to make a unicode text file from a query, I can make the file as a .csv file no problem using chr(34) as the field seperateor character, and all works fine, However I want to create a unicode .txt file that is identical to the same as the file created by excel when I save a .csv as a unicode .txt. After looking around in the cfforum I think I have learnt that I need to use charset=utf-8 attribute in cffiel, but I am not sure what I need to use as the seperator character (ie what does excel use? when it saves as a unicode txt file) many thanks

Oli

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    March 19, 2008
    You can try the code in the following example.

    http://www.cflib.org/udf.cfm?id=1197&enable=1

    In order to save the file in Unicode you can use such as following syntax.

    <cffile action="write" charset="utf-8" file="#myPath#unicodeFile.txt" output="#myUnicodeContent#" />