<?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: Load strings with emojis into mysql db in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682782#M206704</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;However I don't expect any difference&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, long shot, there should be no differences. But there are unexpected things happening at times, and I find it best to leave no stones unturned.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The next steps are the MySQL logs and the SAS Tech Support imho, unless you can find something interesting&amp;nbsp;about emojis+MySQL+UTF-8 on the web, l&lt;/SPAN&gt;&lt;SPAN&gt;ike &lt;A href="https://www.eversql.com/mysql-utf8-vs-utf8mb4-whats-the-difference-between-utf8-and-utf8mb4/" target="_self"&gt;this page&lt;/A&gt;. It seems utf8mb4 should&amp;nbsp;be the default, and anything else is now considered is misconfiguration.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Another idea is to use option sastrace and capture the exact communication taking place between SAS and MySQL.&amp;nbsp;&lt;/SPAN&gt;Something is wrong where the encoding changes after the table was created.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Good luck!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 21:39:08 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-09-09T21:39:08Z</dc:date>
    <item>
      <title>Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682186#M206483</link>
      <description>&lt;P&gt;Dear fellow users, I'm tying to load strings that contain emojis via DI Studio (SAS 9.4) into a MySQL database. I understand that MySQL is a bit tricky when it comes to character sets but I changed the target table to utf8mb4 which definitely stores emojis. When I use the table loader transformation to append my datasets to the table in the database it returns an "invalid utf8 character string" error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I have tried:&lt;/P&gt;&lt;P&gt;1. check the character sets for all parts of the procedure: my data come from jsons and are loaded via the json libname engine. They are correctly stored in a SAS work table. The mysql library is set to utfbmb4 and so is the mysql table.&lt;/P&gt;&lt;P&gt;2. test the database: when inserted through mysql workbench the emojis are stored just fine. The error only occurs if I use the SAS table loader.&lt;/P&gt;&lt;P&gt;3. check different modes of loading the data:&lt;/P&gt;&lt;P&gt;a) If I delete the mysql table, then recreate it and manually set it to utf8mb4 prior to running the load job the character set is reset to utf-8, thus causing the error.&lt;/P&gt;&lt;P&gt;b) If I set the table to utf8mb4, then enter a record manually and run the load job afterwards, the table character set isn't reset and the original record is unaffected. The table loader still returns the same error though.&lt;/P&gt;&lt;P&gt;c) If I delete the mysql table and then let SAS create a new one by running the table loader the new table is set to utf-8 and again the same error shows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this seems to be a problem with how the table loader works. Does anybody know a solution to this?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 10:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682186#M206483</guid>
      <dc:creator>Jazzman</dc:creator>
      <dc:date>2020-09-08T10:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682413#M206558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/74023"&gt;@Jazzman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think SAS is complaining about the Character Set because it doesn't match the database. Character Set issues tend to be complicated; it is probably a good idea to contact SAS Tech Support. They may have helped others with this type of thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;BR /&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 20:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682413#M206558</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2020-09-08T20:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682420#M206560</link>
      <description>&lt;P&gt;Thanks for your reply! However, this is not a SAS error but a database error in my opinion. The error doesn't originate in the attempt to load data with the table loader. It only appears when the data loader encounters a character that's not utf-8 compatible.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 21:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682420#M206560</guid>
      <dc:creator>Jazzman</dc:creator>
      <dc:date>2020-09-08T21:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682467#M206573</link>
      <description>&lt;P&gt;I don't have a solution, just checking if your SAS session and data set use encoding=UTF-8.&lt;/P&gt;
&lt;P&gt;Also, do you use ODBC? Could the ODBC driver be causing the issue?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 01:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682467#M206573</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-09T01:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682533#M206597</link>
      <description>&lt;P&gt;Hello, my SAS session is in UTF-8 and so are all the work tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the SAS MySQL interface, not ODBC.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 07:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682533#M206597</guid>
      <dc:creator>Jazzman</dc:creator>
      <dc:date>2020-09-09T07:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682540#M206600</link>
      <description>&lt;P&gt;You might have to contact SAS Tech Support sadly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anything in the MySQL logs?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Long shot: Does this also happen when you don't use DI, but load directly in SAS?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 08:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682540#M206600</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-09T08:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682580#M206616</link>
      <description>&lt;P&gt;I don't have access to the mysql logs unfortunately. I haven't tried recreating the problem without DI studio. However I don't expect any difference, since I would just recreate the code the DI table loader uses.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 11:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682580#M206616</guid>
      <dc:creator>Jazzman</dc:creator>
      <dc:date>2020-09-09T11:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Load strings with emojis into mysql db</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682782#M206704</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;However I don't expect any difference&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, long shot, there should be no differences. But there are unexpected things happening at times, and I find it best to leave no stones unturned.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The next steps are the MySQL logs and the SAS Tech Support imho, unless you can find something interesting&amp;nbsp;about emojis+MySQL+UTF-8 on the web, l&lt;/SPAN&gt;&lt;SPAN&gt;ike &lt;A href="https://www.eversql.com/mysql-utf8-vs-utf8mb4-whats-the-difference-between-utf8-and-utf8mb4/" target="_self"&gt;this page&lt;/A&gt;. It seems utf8mb4 should&amp;nbsp;be the default, and anything else is now considered is misconfiguration.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Another idea is to use option sastrace and capture the exact communication taking place between SAS and MySQL.&amp;nbsp;&lt;/SPAN&gt;Something is wrong where the encoding changes after the table was created.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Good luck!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 21:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-strings-with-emojis-into-mysql-db/m-p/682782#M206704</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-09T21:39:08Z</dc:date>
    </item>
  </channel>
</rss>

