We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31053
    • 31 Posts
    Hi!
    I'm not native english speaker, please be patient.

    In articles page in manager I can view list of my articles, page title, publish info etc. as well as content preview behind green plus icon. This text generated by backend and returns in JSON through XHR.
    But, if this JSON broken, then list in articles page show nothing.

    I tried figure out problem.

    I use russian language, that means it is multibyte strings. Content preview text trimmed by ellipsis method in ArticleGetListProcessor class (getlist.class.php). That method use simple strlen() and substr() functions. And that is a problem. Sometimes word can be cut in the middle of bytes and we have this problem - http://stackoverflow.com/questions/2124338/why-my-php-substr-shows-obscure-characters-when-cutting-a-text
    As result - JSON can't be normally formatted and crash all.

    So my question is, can I do something in settings in modx or articles component or server setting for resolve this problem?
    Thank you.
      for($i=0; $i<100; $i++) echo &#39;Why is it not working?&#39;;
      • 46654
      • 14 Posts
      Assuming you are russian:
      http://www.php.net/manual/ru/ref.mbstring.php

      There is multibyte functions in PHP you can try to use.

      I haven't used them before, but they might work!