<?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: Urldecoding and SAS Stored process in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/472062#M5717</link>
    <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Here are some suggestions:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;1. Always use UTF-8 based encoding. That means that Ö is encoded as %C3%96, and not %D6.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;2. Specify this option in your SAS Stored Process code to ensure that the URLENCODE/URLDECODE functions use the UTF-8 encoding/decoding method:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options urlencoding=utf8;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This sample code simulates a stored process that gives the desired result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options urlencoding=utf8;

*  Your input parameter;

%let REF=%nrstr(%%C3%%96stersundHuvudlager);

*  Your decoded input parameter;

%let REF_DECODED=%sysfunc(urldecode(&amp;amp;REF));

%put &amp;amp;=REF  &amp;amp;=REF_DECODED;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This technique should work with Unicode and non-Unicode SAS Stored Process Servers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 12:32:18 GMT</pubDate>
    <dc:creator>Vince_SAS</dc:creator>
    <dc:date>2018-06-21T12:32:18Z</dc:date>
    <item>
      <title>Urldecoding and SAS Stored process</title>
      <link>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/471012#M5715</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm running a Stored Process that sometimes will take Swedish letters as an input and I'm having trouble getting sas to Decode them properly.&lt;BR /&gt;so I have a request that looks like this, and the idea is that ref should resolve to ÖstersundHuvudlager.&lt;/P&gt;&lt;P&gt;&lt;A href="http://sebrmsvsasd01.eltel.eltelnetworks.com/SASStoredProcess/do?_PROGRAM=/DPPL/StoredProcesses/radbortagning&amp;amp;ref=%D6stersundHuvudlager&amp;amp;akt=lager&amp;amp;_debug=log" target="_blank"&gt;http://myserver/SASStoredProcess/do?_PROGRAM=/DPPL/StoredProcesses/radbortagning&amp;amp;ref=%D6stersundHuvudlager&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However what I get is ;&lt;/P&gt;&lt;P&gt;REF=&amp;gt;stersundHuvudlager&amp;nbsp;&lt;/P&gt;&lt;P&gt;_ENCODING=UTF-8&lt;/P&gt;&lt;P&gt;_REQENCODING=UTF-8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume this has to do with that the sas encoding is utf-8 and the request isnt. But I'm unsure how to solve it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 09:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/471012#M5715</guid>
      <dc:creator>Kodit</dc:creator>
      <dc:date>2018-06-18T09:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Urldecoding and SAS Stored process</title>
      <link>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/471044#M5716</link>
      <description>&lt;P&gt;When I look at your encoding using %D6 than I find that it encodes for Ö but not in UTF-8. This looks like a Latin encoding. The same character encoded using UTF-8 is&amp;nbsp;%C3%96.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found this doing this in a UTF-8 SAS session:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;24         data _null_;
25         	sw='Östersund';
26         	swe=urlencode(sw);
27         	put _all_;
28         run;

sw=Östersund swe=%C3%96stersund _ERROR_=0 _N_=1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I would have a look at the URL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-- Jan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/471044#M5716</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2018-06-18T12:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Urldecoding and SAS Stored process</title>
      <link>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/472062#M5717</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Here are some suggestions:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;1. Always use UTF-8 based encoding. That means that Ö is encoded as %C3%96, and not %D6.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;2. Specify this option in your SAS Stored Process code to ensure that the URLENCODE/URLDECODE functions use the UTF-8 encoding/decoding method:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options urlencoding=utf8;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This sample code simulates a stored process that gives the desired result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options urlencoding=utf8;

*  Your input parameter;

%let REF=%nrstr(%%C3%%96stersundHuvudlager);

*  Your decoded input parameter;

%let REF_DECODED=%sysfunc(urldecode(&amp;amp;REF));

%put &amp;amp;=REF  &amp;amp;=REF_DECODED;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This technique should work with Unicode and non-Unicode SAS Stored Process Servers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 12:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Urldecoding-and-SAS-Stored-process/m-p/472062#M5717</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-21T12:32:18Z</dc:date>
    </item>
  </channel>
</rss>

