Problems with Japanese (UTF-8)
-
Hello,
entered a text field label in Japanese – and it doesn’t get saved properly./**
* @param null $Id
* @return bool
*/
public function save( $Id = null )
{
global $wpdb;$key = static::$primaryKey;
$data = $this->prepareSaveData( $Id );
$da = $data[‘Label’];
error_log(“BP key: $key data: $da – Id: $Id”,0);Error_LOG:
2019-03-02 21:33:34: (mod_fastcgi.c.2543) FastCGI-stderr: BP-prepareSavedData
2019-03-02 21:33:34: (mod_fastcgi.c.2543) FastCGI-stderr: BP key: Id data: [:en]Name[:ja]名前[:] – Id:
2019-03-02 21:33:34: (mod_fastcgi.c.2543) FastCGI-stderr: BP record updated, key: IdWe clearly see the English/Japanese Label.
Now the database:Database View:
MariaDB [C00002A01]> select Id,Label from f1_GDFormFields;
+—-+—————————-+
| Id | Label |
+—-+—————————-+
| 12 | First Name |
| 13 | Last Name |
| 14 | Payment |
| 15 | Start Date |
| 17 | Email Address |
| 20 | Send |
| 21 | Company Name |
| 23 | Requested Web System |
| 24 | Selectbox |
| 27 | First Name |
| 28 | Last Name |
| 29 | Requested Web System |
| 32 | Domain |
| 35 | Send |
| 36 | Company Name |
| 38 | Payment |
| 39 | Start Date |
| 40 | Domain Already Registered? |
| 53 | Submit |
| 54 | [:en]Name[:ja]??[:] |
| 55 | Email |
| 56 | Message |
| 57 | Captcha |
+—-+—————————-+
23 rows in set (0.00 sec)Only “??” in the database….
BTW, it works with other plugins.
Can you help?BTW,
this code will cause problems with other (non-alphabetical) languages:public function getLabel()
{
if (!empty($this->Label)) {
return wp_unslash($this->Label);
} else {
// return ucfirst($this->Type->getName());
// bp 20190302
return $this->Type->getName();
}
}
-> ucfirst will cripple double-byte text.Best regards,
Bernard
- The topic ‘Problems with Japanese (UTF-8)’ is closed to new replies.