Menu

#481 shorten_utf8 with 4 bytes character

4.2.3
closed-fixed
nobody
None
5
2017-02-20
2015-12-16
sylfabre
No

Hello,

The PHP function shorten_utf8 does not work well with this UTF8 4 bytes character : http://www.fileformat.info/info/unicode/char/1F4A9/index.htm

shorten_utf8('💩') returns '...' insteadof '💩'

Sorry for this character but it's coming from one of my client!

Best,

Discussion

  • sylfabre

    sylfabre - 2015-12-16

    If you need some data to test

    SET NAMES utf8mb4;

    DROP TABLE IF EXISTS test;
    CREATE TABLE test (
    test2 int(11) NOT NULL AUTO_INCREMENT,
    test1 text COLLATE utf8mb4_unicode_ci NOT NULL,
    test3 char(5) COLLATE utf8mb4_unicode_ci NOT NULL,
    test4 varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
    PRIMARY KEY (test2)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

    INSERT INTO test (test2, test1, test3, test4) VALUES
    (10, '💩', '', '');

     
  • Jakub Vrána

    Jakub Vrána - 2017-02-20
    • status: open --> closed-fixed
     
  • Jakub Vrána

    Jakub Vrána - 2017-02-20

    Fixed by https://github.com/vrana/adminer/commit/63b6b993. Hopefully it doesn't break with older PCRE versions.

     
  • sylfabre

    sylfabre - 2017-02-20

    Thank you !

     

Log in to post a comment.

Auth0 Logo