<?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: ODBC to Postgres DB is translating UTF-8 data into Latin1? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747575#M234661</link>
    <description>&lt;P&gt;What is your SAS session encoding?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = encoding ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 13 Jun 2021 00:13:33 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-06-13T00:13:33Z</dc:date>
    <item>
      <title>ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747543#M234639</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tried many solutions here but are encountering a problem still. I am opening an ODBC to a Postgres DB like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname sql_read odbc dsn=OC64 schema=my_schema;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it works, but the problem is the database is encoded with UTF-8, and some columns with unicode characters get translated over to SAS as non-unicode characters. For example,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;≥&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;gets turned into "=".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tested the exact same driver and ODBC in Python, and this problem doesn't exist, i.e. it is not mis-translating the data. So that suggests the problem is not with the driver or ODBC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some other things we've tried are:&lt;/P&gt;&lt;P&gt;1. Ensuring the SAS session encoding is UTF-8. (Verifying this by doing a datalines with UTF-8 characters, which are correctly read)&lt;/P&gt;&lt;P&gt;2. Ensuring the column read into SAS has enough characters (it is character type and length 1024)&lt;/P&gt;&lt;P&gt;3. Trying to use the "correctencoding" argument, e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc datasets library=perm nodetails nolist;&lt;BR /&gt;modify my_table/ correctencoding='utf8';&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;4. Trying to use the "outencoding" argument on the library, e.g.&lt;/P&gt;&lt;P&gt;libname perm "my_path" outencoding='UTF-8';&lt;/P&gt;&lt;P&gt;5. Trying to use a PROC SQL odbc passthrough instead of the libname statement (same result).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2021 15:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747543#M234639</guid>
      <dc:creator>pchilst</dc:creator>
      <dc:date>2021-06-12T15:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747575#M234661</link>
      <description>&lt;P&gt;What is your SAS session encoding?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = encoding ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Jun 2021 00:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747575#M234661</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-06-13T00:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747577#M234662</link>
      <description>&lt;P&gt;It's UTF-8 according to that proc. I am opening SAS by pointing it to the UTF8 config file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jun 2021 00:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747577#M234662</guid>
      <dc:creator>pchilst</dc:creator>
      <dc:date>2021-06-13T00:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747581#M234665</link>
      <description>&lt;P&gt;Hmm, usually encoding problems are solved by aligning encoding settings between applications. It looks like there are some character set differences between Postgres's UTF-8 and SAS's. I'd suggest raising a Tech Support track about this as they are in a better position to help.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jun 2021 00:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747581#M234665</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-06-13T00:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747616#M234690</link>
      <description>Sounds good, thanks for clarifying</description>
      <pubDate>Sun, 13 Jun 2021 14:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/747616#M234690</guid>
      <dc:creator>pchilst</dc:creator>
      <dc:date>2021-06-13T14:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC to Postgres DB is translating UTF-8 data into Latin1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/802778#M316074</link>
      <description>&lt;P&gt;For anyone looking for solutions to this...&lt;BR /&gt;I just had the same problem - UTF8 sas session, UTF8 postgres db, but still getting ANSII characters.&lt;BR /&gt;I have solved it by adding connect settings in ODBC sources:&lt;BR /&gt;&lt;BR /&gt;SET CLIENT_ENCODING TO 'UTF8'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waveson_2-1647607425075.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69555i77153DFEF8A1D58A/image-size/large?v=v2&amp;amp;px=999" role="button" title="waveson_2-1647607425075.png" alt="waveson_2-1647607425075.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 12:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-to-Postgres-DB-is-translating-UTF-8-data-into-Latin1/m-p/802778#M316074</guid>
      <dc:creator>waveson</dc:creator>
      <dc:date>2022-03-18T12:44:18Z</dc:date>
    </item>
  </channel>
</rss>

