• Multibyte String Functions and some changes#

  • AKots Reply #1, 3 years, 4 months ago

    Reply
    In function SmartSubstr are using Multibyte String Functions, but internal character encoding don’t set. Maybe add mb_internal_encoding("UTF-8"); for UTF-8 users?
    - - -
    I see – in MODx using file names “russian-UTF8” (not “russian-utf8&rdquo. This is my mistake – rename please file russian-utf8.inc.php to russian-UTF8.inc.php (if in 0.9.6.3 will be used “russian-UTF8&rdquo.


  • coroico Reply #2, 3 years, 4 months ago

    Reply
    In function SmartSubstr are using Multibyte String Functions, but internal character encoding don’t set. Maybe add mb_internal_encoding("UTF-8"); for UTF-8 users?
    You speak of version 1.7.1 ? This code part has been re-designed in version 1.8.0.

    I see – in MODx using file names “russian-UTF8” (not “russian-utf8&rdquo. This is my mistake – rename please file russian-utf8.inc.php to russian-UTF8.inc.php (if in 0.9.6.3 will be used “russian-UTF8&rdquo.
    In modx0.9.6.2 uf8 languages files are named ".utf8", so you are right the correct russian language file name should be "russian-utf8.inc.php" rather than "russian-UTF8.inc.php". I add an issue about that in JIRA.


  • AKots Reply #3, 3 years, 4 months ago

    Reply
    Quote from: coroico at Oct 01, 2008, 04:08 AM
    You speak of version 1.7.1 ? This code part has been re-designed in version 1.8.0.
    Really looked the old version , but the problem is all the same possible. There are many Multibyte String Functions, and if mb_internal_encoding not set to UTF-8 by default at hosting, maybe some problems.


  • coroico Reply #4, 3 years, 4 months ago

    Reply
    In the setPageCharset function of the version 1.8, we have:
        // Ajax window charset = UTF-8 and should to be coherent with database
        if (isset($this->dbCharset) && isset($this->pageCharset[$this->dbCharset])) {
          // check if the mbstring extension is required and loaded
          if ($this->dbCharset != 'utf8' && !extension_loaded('mbstring')) {
            $msgErr = "php_mbstring extension required";
          }
          else {
            $this->pgCharset = $this->pageCharset[$this->dbCharset];
            $valid = true;
          }
        }


    is this modification acceptable for you ? :
        // Ajax window charset = UTF-8 and should to be coherent with database
        if (isset($this->dbCharset) && isset($this->pageCharset[$this->dbCharset])) {
          // check if the mbstring extension is required and loaded
          if ($this->dbCharset != 'utf8' && !extension_loaded('mbstring')) {
            $msgErr = "php_mbstring extension required";
          }
          else {
            mb_internal_encoding("UTF-8");
            $this->pgCharset = $this->pageCharset[$this->dbCharset];
            $valid = true;
          }
        }


  • AKots Reply #5, 3 years, 4 months ago

    Reply
    Quote from: coroico at Oct 01, 2008, 06:10 AM
    is this modification acceptable for you ?
    Yes!