<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Encoding when reading data from api in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426343#M105032</link>
    <description>&lt;P&gt;That is not possible. I need a solution where the encoding is converted to my sas encoding,&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 09:14:43 GMT</pubDate>
    <dc:creator>rudfaden</dc:creator>
    <dc:date>2018-01-10T09:14:43Z</dc:date>
    <item>
      <title>Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426050#M104950</link>
      <description>&lt;P&gt;How do I get the correct encoding for this data i am retrieving form with an api? The Danish letters æ,ø,å does not show corret&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src temp encoding="utf-8";
proc http
     method="GET"
     url="%nrstr(https://dawa.aws.dk/adresser?q=Ærøgade&amp;amp;struktur=mini&amp;amp;per_side=1&amp;amp;format=csv)"
     out=src;
    run;
	data _null_;
	infile src;
	input;
	put _infile_;
	run;
	data test ;
	infile src encoding="utf-8" dlm=',' missover dsd firstobs=2 ;
	length id $ 36 status $1 vejkode $4 vejnavn $20 adresseringsvejnavn $20 husnr $10 etage $10 dor $10 supplerendebynavn $10 postnr $4 postnrnavn $20 kommunekode $4 adgangsadresseid $36 x 8 y 8 ;  
   input id $ status $ vejkode $ vejnavn $ adresseringsvejnavn $ husnr $ etage$ dor $ supplerendebynavn $ postnr $ postnrnavn $ kommunekode $ adgangsadresseid x y;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Data example&lt;/P&gt;&lt;PRE&gt;id,status,vejkode,vejnavn,adresseringsvejnavn,husnr,etage,dÃ¸r,supplerendebynavn,postnr,postnrnavn
,kommunekode,adgangsadresseid,x,y
0a3f50b3-135b-32b8-e044-0003ba298018,1,0365,Ã†rÃ¸gade,Ã†rÃ¸gade,2,,,,5960,Marstal,0492,0a3f5088-8b
75-32b8-e044-0003ba298018,10.51420646,54.85857924&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jan 2018 12:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426050#M104950</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2018-01-09T12:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426066#M104956</link>
      <description>&lt;P&gt;What is your SAS session encoding?&amp;nbsp; This is normally setup when SAS starts up, you would need to change it there.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 13:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426066#M104956</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-09T13:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426343#M105032</link>
      <description>&lt;P&gt;That is not possible. I need a solution where the encoding is converted to my sas encoding,&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426343#M105032</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2018-01-10T09:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426345#M105033</link>
      <description>&lt;P&gt;I don't believe that is possible.&amp;nbsp; If your SAS session is Wlatin, and the data coming in has UTF-8 or 16, which both have far more characters in their sets, then "converting" data is not possible as the wlatin charset is too small to handle it.&amp;nbsp; This is what you are seeing now, where the character set just says I don't know and puts a strange symbol.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/426345#M105033</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-10T09:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/435187#M108079</link>
      <description>&lt;P&gt;I found a solution. Basically you save the file with utf-8 and then open it with wlatin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename resp "C:\Temp\map.json";
    filename minmap 'C:/Temp/gogle_distance.map';

    proc http
     url="https://maps.googleapis.com/maps/api/directions/json?origin=&amp;amp;home.%nrstr(&amp;amp;destination=)&amp;amp;work."
     method= "GET"
     out=resp;
    run;

    %** trick der gøre at JSON filen encodes med wlatin;
    filename resp "C:\Temp\map.json" encoding='utf-8';
    filename resp1 "C:\Temp\map1.json" encoding='wlatin1';

    data _null_;
      infile resp;
      file resp1;
      input;
      put _infile_;
    run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 10:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/435187#M108079</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2019-03-18T10:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding when reading data from api</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/435190#M108080</link>
      <description>&lt;P&gt;I am not talking about converting the whole charset to from utf-8 to wlatin. Only those that are in wlatin&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 08:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-when-reading-data-from-api/m-p/435190#M108080</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2018-02-08T08:31:09Z</dc:date>
    </item>
  </channel>
</rss>

