Posted 17 февраля, 20223 yr Я только что понял, что все настраиваемые текстовые поля показывают странные символы в базе данных. Например, «João» получается как «Jo\u00e3o». Я думаю, что это связано с system\Text\Parser.php, но я не уверен, что нужно изменить, чтобы символы отображались правильно. Настройки базы данных выглядят правильно: Edited 17 февраля, 20223 yr by BlackShot
17 февраля, 20223 yr Author Seems to be something related with JSON_UNESCAPED_UNICODE and json_encode().
18 февраля, 20223 yr Author 1 hour ago, Desti said: U about custom profile fields? That's right! They use some kind of logic I still don't understand apparently.
19 февраля, 20223 yr Author 2 hours ago, Desti said: standard setup, no problem Пробовали ли вы создать пользовательское *текстовое* поле в Nexus/Commerce? Я получил этот ответ от кого-то: Quote Прежде всего, \u00e3 не генерируется MySQL. Однако он может быть сгенерирован функцией PHP json_encode(). Обязательно используйте JSON_UNESCAPED_UNICODE во втором аргументе этой функции. Для использования в таблицах MySQL я предпочитаю, чтобы настройки подключения и сервера были постоянно установлены на utf8mb4, чтобы данные Unicode просто появлялись и исчезали без преобразования.
20 февраля, 20223 yr Author 18 hours ago, Desti said: Mine doesn't have that cm prefix. Maybe it's an older/newer version? Anyway, how about core_pfields_data (pf_content) or nexus_support_fields (sf_extra)?
20 февраля, 20223 yr system/CustomField/CustomField.php - Search json_encode and edit string $values[ static::$databasePrefix . $k ] = ( $k === 'content' ? json_encode( $_value, JSON_UNESCAPED_UNICODE ) : $_value ); All custom field (and nexus too) must work properly Edited 20 февраля, 20223 yr by Desti
21 февраля, 20223 yr Author 18 hours ago, Desti said: system/CustomField/CustomField.php - Search json_encode and edit string $values[ static::$databasePrefix . $k ] = ( $k === 'content' ? json_encode( $_value, JSON_UNESCAPED_UNICODE ) : $_value ); All custom field (and nexus too) must work properly Aha! Works perfectly now - you're a legend! Why do you think IPS didn't have that added in the first place? You think they just missed it, didn't consider their international userbase, or does it affect performance/security? 🤔
21 февраля, 20223 yr I suspect that for them the great revelation was the existence of other languages
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.