Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特定の文字を送信すると文字化けする #2483

Closed
seto1 opened this issue Jun 22, 2023 · 6 comments
Closed

特定の文字を送信すると文字化けする #2483

seto1 opened this issue Jun 22, 2023 · 6 comments
Assignees
Labels
Bug バグ Reviewed レビュー済

Comments

@seto1
Copy link
Collaborator

seto1 commented Jun 22, 2023

概要

例: 「瞭」を送信すると「迸ュ」に変換される

スクリーンショット 2023-06-22 20 52 20

送信データを変換している箇所で文字化けする
https://github.com/baserproject/basercms/blob/dev-5/plugins/baser-core/src/Controller/AppController.php#L254

BcEncode.detectOrderから「SJIS-win」を削除すると文字化けしない
https://github.com/baserproject/basercms/blob/dev-5/plugins/baser-core/config/setting.php#L734

PHP8.1だとmb_detect_orderの仕様が変更されていることが原因の可能性
https://speakerdeck.com/pakutoma/how-we-have-responded-to-the-php-8-dot-1-mbstring-specification-changes

baserCMS version : 5.0.2-dev

TODO

  • BcEncode.detectOrderから「SJIS-win」を削除して問題ないかの確認
  • そもそも送信データをUTF-8に変換する処理が必要かの確認
@ryuring ryuring added the Bug バグ label Jun 23, 2023
@ryuring ryuring assigned HungDV2022 and ryuring and unassigned HungDV2022 Sep 15, 2023
@ryuring ryuring added the Reviewed レビュー済 label Sep 23, 2023
@ryuring
Copy link
Collaborator

ryuring commented Sep 23, 2023

@seto1 こちら最新の開発版で確認したところ再現できませんでした。一度確認して頂いてもいいですか?

@ryuring ryuring assigned seto1 and unassigned ryuring Sep 23, 2023
@seto1
Copy link
Collaborator Author

seto1 commented Sep 27, 2023

@ryuring 環境の違いでしょうか。
再度ローカルの最新版で確認したところ再現したほか、デモサイトでも再現しました。
https://trial.basercms.net/baser/admin/bc-blog/blog_posts/add/1

ブラウザは以下で確認しました。

  • Chrome
  • Chrome シークレットモード
  • Safari

@seto1
Copy link
Collaborator Author

seto1 commented Sep 27, 2023

「瞭」だけ送信するかによっても変わりますね。
「明瞭」だと正常に保存できました。

@seto1
Copy link
Collaborator Author

seto1 commented Oct 25, 2023

EUC-JP: 大槻

@kaburk
Copy link
Collaborator

kaburk commented Nov 2, 2023

https://trial.basercms.net/にて 幾つか試しましたが、現象が再現しました。
< p >タグとかで囲われると大丈夫な場合があったり、幾つか条件ありそうではあります。

保存前
スクリーンショット 2023-11-02 10 18 33
保存後
スクリーンショット 2023-11-02 10 18 47
スクリーンショット 2023-11-02 10 18 55

@ryuring ryuring closed this as completed in f4180c0 Nov 4, 2023
@ryuring
Copy link
Collaborator

ryuring commented Nov 4, 2023

@seto1 @kaburk 確認ありがとうございます。
加賀澤さんとも話したのですが、今どき送信データがUTF-8でないこと自体が問題だろうということになったので、変換処理を削除しました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug バグ Reviewed レビュー済
Projects
None yet
Development

No branches or pull requests

4 participants