cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Write file to US-ASCII file format

Ajay_Chawda
Contributor

Hello Experts ,
Iโ€™m trying to write file in US-ASCII file format.

i have used mapperโ€“>binary copyโ€“>transcoderโ€“>file writer snap.

Mapper has input string and binary output. Binary copy snap to make copy of result of mapper.
transcoder snap with setting UTF-8 to US-ANSCII format and then file writer snap to write file.

But transcoder fails with error saying โ€œFailed to transcode from UTF-8 to US-ASCII, reason=The character set in the input data may not be UTF-8,โ€

image

image

above pipeline is getting triggered from parent pipeline which pass input string to this pipeline.

Any suggestion what wrong iโ€™m doing over here?

Regards,
Ajay

4 REPLIES 4

ptaylor
Employee
Employee

Hi Ajay,

Can you please explain how your Mapper is configured? Itโ€™s very unusual to have binary output for a Mapper.

What sort of file are you trying to write? A JSON file?

@ptaylor thank you for reply, trying to write plain string to file in ascii format. used mapper with binary output view to avoid additional snap to convert document to binary.

Ok. And youโ€™ve set up the Mapper to map a string from the input document to the special field content, like this?
image

Why do you need the Transcoder? The ASCII character set is extremely limited (only 128 characters) so if there are characters in the input that canโ€™t be transcoded to ASCII that would be why youโ€™re seeing that error. (The error message is confusing.)