S
S
Seva2014-10-27 14:59:38
MODX
Seva, 2014-10-27 14:59:38

MODx, MIGX and Cyrillic?

Good day!
The problem is this: if you enter data in the admin panel in TV with the MIGX type, then the Cyrillic alphabet is entered and displayed normally, but it is written to the database as

"color":"\u0410\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u0438\u0439 \u043e\u0440\u0435\u0445"
instead of human Cyrillic, and this is important, because the customer exports the entire database of goods in .csv and then works with it.
I tried both utf_general_ci and utf_unicode_ci base encoding, nothing changed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Seva, 2014-10-27
@Zewkin

I asked myself, I answer myself:
in the /core/xpdo/xpdo.class.php file, on line 2365, the toJSON function is declared, which now looks like this:

public function toJSON($array) {
        $encoded= '';
        if (is_array ($array)) {
            //  if (!function_exists('json_encode')) {
            //    if (@ include_once (XPDO_CORE_PATH . 'json/JSON.php')) {
            //      $json = new Services_JSON();
            //    $encoded= $json->encode($array);
            //  }
            // } else {
                $encoded= json_encode($array, JSON_UNESCAPED_UNICODE);
            //}
        }
        return $encoded;
    }

I
Ilya Plotnikov, 2014-10-27
@ilyaplot

It looks like json.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question