2021-03-26 21:26:01

Hi there,
I am wondering for how to fix the UTF8 with BGT?
The issue that when i need to create the translation system, and I used a language with UTF8 code, I got a weird letters in the game,
Tried to find a reason for why that happened in my code, but I can't fix it.
The chat messages working fine, but the game when it get the translated text from a file, will get a weird letters due to the utf8 issue.
I am not sure how to clear that for you, but sadly, I can't find the this bug and fix it.
I have another small app, used the translation with it, and I don't have this issue at all.
If anyone have some suggestions that can help me, will be so helpful.

----------
Best regards,
Hamad.

2021-03-26 21:30:30

We can't do much without code. Also, if it only happens in certain cases, it's most likely your code in the app it does happen to, unless you're using DLLs, in which case, don't; that's actually why Nyanchan didn't use BGT. It couldn't handle UTF-8 with DLLs properly, and would just spit out gibberish when he tried to make it talk to his screen reader.

2021-03-26 21:52:05 (edited by hamad_alqasar 2021-03-26 21:54:17)

no sadly, I am not using a dll,
and that's right I should add a code here, but not sure from where that issue to throw it to check it.
I am still trying, will update if something changes, still checking the replies here from time to time.
Oh god, i tested now the alert function, and used the Arabic language, and got the issue, but when i create a test file outside my project, i didn't have this issue.
that's so confused.

----------
Best regards,
Hamad.

2021-03-26 21:59:02

okay, i think i fixed it, I used ANSI Encoding in notepad, i don't know why, but let me test more.

----------
Best regards,
Hamad.

2021-03-26 22:03:04

alright, that's it guys, use the ANSI Encoding  and everything will works, UTF8 will not works, hope that will helps, thanks smile

----------
Best regards,
Hamad.

2021-03-27 04:24:45 (edited by Ethin 2021-03-27 04:26:25)

I don't think BGT is UTF-8 aware or capable of interpreting UTF-8 character sequences. ASCII will obviously work, but anything beyond the 8-bit ASCII character set (e.g.: something that's 2 or 3 bytes long) will probably not be interpreted correctly when stringified.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2021-03-28 05:41:24

that's correct, I tested that, it's return a question marks.

----------
Best regards,
Hamad.

2021-04-05 02:29:19

change the codification of your file to ancii.
I recomend use notepad++
sorry for my bad english.