Raised This Month: $9 Target: $400
 2% 

Can't compile regex expression.


Post New Thread Reply   
 
Thread Tools Display Modes
T1MOXA
Member
Join Date: Aug 2016
Old 07-23-2018 , 07:31   Re: Can't compile regex expression.
Reply With Quote #11

Then I get errors like this:
Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

...


Although it seems that this problem is due to incorrect database encoding...

Last edited by T1MOXA; 07-23-2018 at 07:34.
T1MOXA is offline
T1MOXA
Member
Join Date: Aug 2016
Old 08-22-2018 , 19:23   Re: Can't compile regex expression.
Reply With Quote #12

Today I encountered an error "Incorrect string value: '\xF0\x9F\x92\x8B\xF0\x9F...' for column 'name' at row 1".
The database is encoded utf8mb4_general_ci.
The column too.
What else could be the problem ?
T1MOXA is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-22-2018 , 20:19   Re: Can't compile regex expression.
Reply With Quote #13

That error appears to mean you have bytes that can't be a valid UTF8 character.
Fyren is offline
T1MOXA
Member
Join Date: Aug 2016
Old 08-23-2018 , 06:06   Re: Can't compile regex expression.
Reply With Quote #14

Quote:
Originally Posted by asherkin View Post
You should really consider switching to the utf8mb4 charset.
Quote:
Originally Posted by asherkin View Post
No you won’t, the input/output is still UTF-8, it just allows characters outside of the BMP to be stored.
I did just that.
Just changed the encoding in the database.
T1MOXA is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-23-2018 , 19:44   Re: Can't compile regex expression.
Reply With Quote #15

If you're sure you've set the table and column charsets, in your plugin you can try (SQL_)SetCharset if using 1.10 or maybe doing SET NAMES 'utf8mb4' if not to set the connection's charset.
Fyren is offline
T1MOXA
Member
Join Date: Aug 2016
Old 08-29-2018 , 16:56   Re: Can't compile regex expression.
Reply With Quote #16

Quote:
Originally Posted by Fyren View Post
If you're sure you've set the table and column charsets, in your plugin you can try (SQL_)SetCharset if using 1.10 or maybe doing SET NAMES 'utf8mb4' if not to set the connection's charset.
Yes, this probably would solve the problem, but this option is not suitable because too many plugins use the database, and will have to rewrite everything.
It is easier to remove the symbol with a regular expression, but for some reason it does not work on SM.
I am interested to hear @asherkin
T1MOXA is offline
T1MOXA
Member
Join Date: Aug 2016
Old 09-16-2018 , 21:05   Re: Can't compile regex expression.
Reply With Quote #17

Thank you, not knew about this rule.
Okay, how do I solve my problem ?
@asherkin not responding.
T1MOXA is offline
T1MOXA
Member
Join Date: Aug 2016
Old 09-16-2018 , 21:07   Re: Can't compile regex expression.
Reply With Quote #18

I have 2 problems at the moment.
1. Regex expresion to remove emoji not working
2. utf8mb4_general_ci encoding didn't help


database charset - utf8mb4
database collation - utf8mb4_general_ci
table collation - utf8mb4_general_ci
row collation - utf8mb4_general_ci

What's wrong ?

Last edited by T1MOXA; 09-16-2018 at 21:41.
T1MOXA is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:59.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode