Support » Plugins » Cyryllic chars in plugins

  • Hello! I have the following problem: when I execute code

    $a=preg_split("#([\w]+)#i","Привет, дружище!", -1, PREG_SPLIT_DELIM_CAPTURE);
    print_r($a);

    Outside of WordPress, it returns

    Array
    (
        [0] =>
        [1] => Привет
        [2] => ,
        [3] => дружище
        [4] => !
    )

    What is correct. However, when I do it in the plugin:
    $this->words=preg_split("#([\w]+)#i","Привет, дружище!",-1,PREG_SPLIT_DELIM_CAPTURE);
    print_r($this->words);

    It returns
    `Array
    (
    [0] =>
    [1] => Приве�
    [2] => �,
    [3] => дру�
    [4] => �
    [5] => и�
    [6] => �
    [7] => е
    [8] => !
    )`
    Even more, the latter crappy array changes every time! Any suggestions? TIA

    By the way, the same issue can be seen even after you make the brand new installation and then change the text of “Hello, Dolly” plugin to some cyryllics – it won’t display!

  • The topic ‘Cyryllic chars in plugins’ is closed to new replies.