Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using cffile to make a unicode textfile

Explorer ,
Mar 18, 2008 Mar 18, 2008
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

640
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 19, 2008 Mar 19, 2008
LATEST
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#" />

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources