[wp-trac] [WordPress Trac] #32136: strip_invalid_text removes all russian utf8 chars

WordPress Trac noreply at wordpress.org
Fri Jul 17 14:07:44 UTC 2015


#32136: strip_invalid_text removes all russian utf8 chars
--------------------------+----------------------
 Reporter:  Fahrain       |       Owner:  pento
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Database      |     Version:  4.2
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by Fahrain):

 i don't think this changes will help. I'll try it on holidays on my test
 site
 i think that there only one correct way to detect correct encoding - get
 current connection settings from db: wordpress kernel uses
 $this->set_charset( $this->dbh, $charset ); to set encoding (and similar
 function to get this back). But everywhere in code this encoding taken
 from configuration file and if it is wrong (not the same that really used
 for database/query) we have problem. You can try to check - is database
 queries encoding was changed with $wpdb->query("SET
 CHARACTER_SET_CLIENT='cp1251'"); or similar sql commands - it can be more
 correct way to detect actual encoding which was used on wpdb query, but it
 can't be done without more sql requests. Function strip_invalid_text
 trying not use sql queries for encoding detection if it can detect
 encoding but it really can't detect correct encoding without sql request.
 So...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32136#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list