“Incorrect string value” errors with MySQL even with utf8mb4_unicode_ci





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















My database stores server hostnames of Garry's Mod servers (Source Dedicated Servers) and sometimes they seem to contain characters that utf8mb4_unicode_ci can't store. What are these characters and how do I fix the issue?



insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP())


Incorrect string value: 'xE9dxE9rat...'



IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: 'xE9dxE9rat...' for column 'hostname' at row 1 (SQL: insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP()))
File "app/Http/Controllers/PayloadController.php", line 243, in GetPayload
$Server -> save();
File "public/index.php", line 55
$request = IlluminateHttpRequest::capture()









share|improve this question





























    1















    My database stores server hostnames of Garry's Mod servers (Source Dedicated Servers) and sometimes they seem to contain characters that utf8mb4_unicode_ci can't store. What are these characters and how do I fix the issue?



    insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP())


    Incorrect string value: 'xE9dxE9rat...'



    IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: 'xE9dxE9rat...' for column 'hostname' at row 1 (SQL: insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP()))
    File "app/Http/Controllers/PayloadController.php", line 243, in GetPayload
    $Server -> save();
    File "public/index.php", line 55
    $request = IlluminateHttpRequest::capture()









    share|improve this question

























      1












      1








      1








      My database stores server hostnames of Garry's Mod servers (Source Dedicated Servers) and sometimes they seem to contain characters that utf8mb4_unicode_ci can't store. What are these characters and how do I fix the issue?



      insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP())


      Incorrect string value: 'xE9dxE9rat...'



      IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: 'xE9dxE9rat...' for column 'hostname' at row 1 (SQL: insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP()))
      File "app/Http/Controllers/PayloadController.php", line 243, in GetPayload
      $Server -> save();
      File "public/index.php", line 55
      $request = IlluminateHttpRequest::capture()









      share|improve this question














      My database stores server hostnames of Garry's Mod servers (Source Dedicated Servers) and sometimes they seem to contain characters that utf8mb4_unicode_ci can't store. What are these characters and how do I fix the issue?



      insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP())


      Incorrect string value: 'xE9dxE9rat...'



      IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: 'xE9dxE9rat...' for column 'hostname' at row 1 (SQL: insert into `servers` (`steamid64`, `script_id`, `ip_address`, `port`, `uses`, `hostname`, `maxplayers`, `map`, `last_active`) values (XXXXXXXXXXXXXXX, 1599, XXXXXXXXXXXXXXXX, 27095, 1, [FR] USA vs F?d?ration | Apocalypse | SeriousRP | TSF, 20, rp_evocity_dc, CURRENT_TIMESTAMP()))
      File "app/Http/Controllers/PayloadController.php", line 243, in GetPayload
      $Server -> save();
      File "public/index.php", line 55
      $request = IlluminateHttpRequest::capture()






      php mysql sql character-encoding






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 26 '18 at 23:35









      BillyBilly

      438




      438
























          1 Answer
          1






          active

          oldest

          votes


















          1














          You were hoping for ...édérat... ?



          Your client is using latin1, not utf8mb4.



          Perhaps the simplest fix is to tell mysql that you are using latin1 in the client. This is best done in the connection string. (Are you using PDO or mysqli?)



          Note: The encoding of the client and the encoding in the database table are independent. The transcoding is automatic. But you must be correct in declaring the encoding in the client.






          share|improve this answer
























          • I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

            – Billy
            Nov 28 '18 at 9:14











          • @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

            – Rick James
            Nov 28 '18 at 15:55












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490673%2fincorrect-string-value-errors-with-mysql-even-with-utf8mb4-unicode-ci%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You were hoping for ...édérat... ?



          Your client is using latin1, not utf8mb4.



          Perhaps the simplest fix is to tell mysql that you are using latin1 in the client. This is best done in the connection string. (Are you using PDO or mysqli?)



          Note: The encoding of the client and the encoding in the database table are independent. The transcoding is automatic. But you must be correct in declaring the encoding in the client.






          share|improve this answer
























          • I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

            – Billy
            Nov 28 '18 at 9:14











          • @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

            – Rick James
            Nov 28 '18 at 15:55
















          1














          You were hoping for ...édérat... ?



          Your client is using latin1, not utf8mb4.



          Perhaps the simplest fix is to tell mysql that you are using latin1 in the client. This is best done in the connection string. (Are you using PDO or mysqli?)



          Note: The encoding of the client and the encoding in the database table are independent. The transcoding is automatic. But you must be correct in declaring the encoding in the client.






          share|improve this answer
























          • I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

            – Billy
            Nov 28 '18 at 9:14











          • @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

            – Rick James
            Nov 28 '18 at 15:55














          1












          1








          1







          You were hoping for ...édérat... ?



          Your client is using latin1, not utf8mb4.



          Perhaps the simplest fix is to tell mysql that you are using latin1 in the client. This is best done in the connection string. (Are you using PDO or mysqli?)



          Note: The encoding of the client and the encoding in the database table are independent. The transcoding is automatic. But you must be correct in declaring the encoding in the client.






          share|improve this answer













          You were hoping for ...édérat... ?



          Your client is using latin1, not utf8mb4.



          Perhaps the simplest fix is to tell mysql that you are using latin1 in the client. This is best done in the connection string. (Are you using PDO or mysqli?)



          Note: The encoding of the client and the encoding in the database table are independent. The transcoding is automatic. But you must be correct in declaring the encoding in the client.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 '18 at 5:16









          Rick JamesRick James

          71k566106




          71k566106













          • I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

            – Billy
            Nov 28 '18 at 9:14











          • @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

            – Rick James
            Nov 28 '18 at 15:55



















          • I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

            – Billy
            Nov 28 '18 at 9:14











          • @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

            – Rick James
            Nov 28 '18 at 15:55

















          I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

          – Billy
          Nov 28 '18 at 9:14





          I'm using PDO, via Laravel. It should already be set to utf8mb4. The encoding sent by the client is just sent via a HTTP request from a gameserver running Lua, so I would have no idea what that could be, but I'm fairly sure it should just use UTF-8.

          – Billy
          Nov 28 '18 at 9:14













          @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

          – Rick James
          Nov 28 '18 at 15:55





          @Billy - Hex E9 is not a valid UTF-8 encoding. It is (at least) the latin1 encoding for e-acute. If you can change the html, the form should say something like <form accept-charset="UTF-8">.

          – Rick James
          Nov 28 '18 at 15:55




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490673%2fincorrect-string-value-errors-with-mysql-even-with-utf8mb4-unicode-ci%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen