mantisbt-plugins / Snippets

Define snippets of text that can be easily pasted into text fields
MIT License
8 stars 12 forks source link

characters are problematic #64

Closed imuratbayik closed 1 year ago

imuratbayik commented 1 year ago

Hello, thank you very much for this nice plugin. Some of the Turkish characters are problematic. I mean, The Turkish character is Ü Ç Ö I ç ö okey but, Ğ İ Ş ğ ı ş not okey. These come out as question marks. ? in this way. How can we/you fix this. Can you help me?

dregad commented 1 year ago

Not sure I understand the problem. Is it language strings (plugin UI), or snippet text (user data) ? On which page(s) ? Can you provide a better explanation (what you do, what you get, what you expect to get) and maybe provide screenshot(s) to illustrate ?

dregad commented 1 year ago

FYI This is what I get (copy/paste of your text above)... looks good to me

image

imuratbayik commented 1 year ago

plugin.php?page=Snippets/snippet_list When I create a new snippet, it looks like the picture I added now. Could it be something with the database structure? I am also attaching the database image.

Ekran Resmi 2022-12-20 18 50 50 Ekran Resmi 2022-12-20 18 48 00 Ekran Resmi 2022-12-20 18 35 43 Ekran Resmi 2022-12-20 18 35 24 Ekran Resmi 2022-12-20 18 35 59 Ekran Resmi 2022-12-20 18 36 28

dregad commented 1 year ago

I see from your phpMyAdmin screenshot that you are using utf8_general_ci collation. In MySQL < 8.0, this actually defaults to the utf8mb3 character set, which actually stores characters with 3 bytes instead of the 4 required to cover the full Unicode range, so it does not support all characters.

You most likely have the same problem throughout MantisBT, and not just Snippets, because the installer creates the tables like that. This is a known issue with MantisBT.

You should convert your database (schema, tables and columns) to utf8mb4. There are plenty of resources explaining how to do that, e.g. https://dev.mysql.com/blog-archive/mysql-8-0-collations-migrating-from-older-collations/

I do not expect this migration to cause any issues, except a possible increase in size, but still you should make sure to have a backup at hand, just in case.

Since this is not an issue of the Snippets plugin, I'm going to close this.