utf-8 file output

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

blekota74
Posts: 11
Joined: Thu Jun 23, 2011 9:46 am

utf-8 file output

Postby blekota74 » Thu Jun 23, 2011 9:57 am

Hi all, I am 3 days CloverETL user I am doing experiments with writing data to text files with different coding using UniversalDataWriter Component.
The problem is when I want to create an uft-8 file. CloverETL creates it but I would like to add BOM character just to mark the file as utf-8. It is really annoying me when other applications do not recognized the coding and I am force to point proper one (for instance Word when I use utf-8 text file as source data)

Cheers Rafal

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Re: utf-8 file output

Postby avackova » Thu Jun 23, 2011 1:50 pm

Hello Rafal,
I've created an issue with your request (https://bug.javlin.eu/browse/CL-1823) in our issue tracking system. Please check it, if we have properly understood your requirements. Use guest/guest as username/password credentials.
As a workaround, you can create a branch, that adds a BOM character to the output file. But remember to set append attribute to true in subsequent Writer (see attached graph).
Attachments
BOM.grf
(3.95 KiB) Downloaded 258 times
Agata Vackova
Javlin a.s.
[email protected]

blekota74
Posts: 11
Joined: Thu Jun 23, 2011 9:46 am

utf-8 file output

Postby blekota74 » Wed Jun 29, 2011 9:03 am

Hi, it works :) -but in the example you set charset as UTF-16BE instead UTF-8.
Rafal

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Re: utf-8 file output

Postby avackova » Wed Jun 29, 2011 11:18 am

Yes, the graph should work for all encodings: for charsets starting with UTF string it writes BOM character in the beginning of the file and for others it doesn't.
Agata Vackova

Javlin a.s.

[email protected]

blekota74
Posts: 11
Joined: Thu Jun 23, 2011 9:46 am

Re: utf-8 file output

Postby blekota74 » Thu Jun 30, 2011 8:56 am

To avoid appending \r\n in the very first line of the output file (in the example graph) I defined a new metadata:

<Metadata id="Metadata0" previewAttachmentCharset="ISO-8859-1">
<Record fieldDelimiter="|" name="recordName1" previewAttachmentCharset="ISO-8859-1" type="delimited">
<Field delimiter="\" name="field1" type="string"/>
</Record>
</Metadata>


I replaced Field delimeter with "\". By default this value for the last field is "\r\n"