Skip to main content

Hi Team,

 

FILE ->SetPayload-> TM-> HTTPS

above one is my flow which has .csv file and encoding was 1255 (Hebrew). I am picking the file from folder and transforming that csv file as JSON with encoding="windows-1255" , after dataweave transform my payload response completely changing as "?". input payload has Hebrew language that was not able to identified by the TM. Could you please help me how to solve this issue.

 

TM header:

 

%dw 1.0

%input payload test/csv

//%output application/json encoding="ISO-8859-8"

%output application/json encoding="windows-1255"

8 answers
  1. Aug 24, 2018, 7:14 PM

    @ramugudivada please check if this is what your looking for

     

    CSV input file:

     

    A,B,C,D,E

    Price,גזברות,1,Reasons,FALSE

    Price,הנחה קטלוג לקוח,2,Reasons,FALSE

    Price,מזומן,3,Reasons,FALSE

     

    CSV Output file:

     

    {

    "Headers": [

    "A",

    "B",

    "C",

    "D",

    "E "

    ],

    "Line": [

    [

    "Price",

    "גזברות",

    "1",

    "Reasons",

    "FALSE "

    ],

    [

    "Price",

    "הנחה קטלוג לקוח",

    "2",

    "Reasons",

    "FALSE "

    ],

    [

    "Price",

    "מזומן",

    "3",

    "Reasons",

    "FALSE"

    ]

    ]

    }

     

    flow config:

     

    <flow name="sssFlow2">

    <file:inbound-endpoint path="E:\personal\csv" responseTimeout="10000" doc:name="File"/>

    <dw:transform-message doc:name="Transform Message">

    <dw:input-payload/>

    <dw:set-payload><![CDATA[%dw 1.0

    %output application/json encoding="UTF-8"

    ---

    {

    Headers: payload[0] pluck $$,

    Line : payload map {

    in: $ pluck $

    }.in

    }] ]></dw:set-payload>

    </dw:transform-message>

    <logger message="#&nbsp;[payload]" level="INFO" doc:name="Logger"/>

    <file:outbound-endpoint path="E:\personal\out" responseTimeout="10000" doc:name="File"/>

    </flow>

0/9000