Half-Life и Adrenaline Gamer форум

Всё об игре в Халф-Лайф и АГ
Текущее время: 28 апр 2024, 10:57

Часовой пояс: UTC + 5 часов [ Летнее время ]




Начать новую тему Ответить на тему  [ Сообщений: 21 ]  На страницу Пред.  1, 2, 3  След.
Автор Сообщение
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 14 июн 2023, 19:52 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
Leo I apologize I didn't explain this part as well
In order for the sentence to be printed correctly in the game, it is written from left to right in connected letters and takes this form :
"ﻣﻛﻟﺎﺣ ﻓﻳﻛ ﻣﻛﻳﻟﻋ ﻣﺎﻟﺳ"
I copied it from inside the game from right to left, as in the previous result. I don't understand why it shifts again from left to right if I copied it outside the game
You can try the sentence in the game to see the results in the chat will become right to left.
The same thing often happens in programs that do not support the Arabic language, and there are some sites that offer a correction for this problem, such as: arabic-keyboard
Here the comparison result is completely different or the program does not recognize the rtl2.txt file.
Вложение:
rtl1.txt [40 байт]
Скачиваний: 42

Вложение:
rtl2.txt [57 байт]
Скачиваний: 44


Вложения:
Capture.PNG
Capture.PNG [ 37.16 КБ | Просмотров: 894 ]

_________________
https://vk.com/kgbaghl
Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 15 июн 2023, 23:54 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
27 апр 2024, 13:55
Сообщения: 6867
These files are encoded differently. One use 2 byte per letter second one use 3 bytes per letter. Not sure why, but UTF-8 supports this. Probably these are just different letters with higher indexes.
Answer this question: can you output text in a correct form in the HL sceen or not? You can try to insert text from rtl2.txt file right into the plugin file.
If no, probably it is not possible. And, BTW, use Steam version (or new non-steam) UTF support threre could be better.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 12:31 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
Lev писал(а):
These files are encoded differently. One use 2 byte per letter second one use 3 bytes per letter. Not sure why, but UTF-8 supports this. Probably these are just different letters with higher indexes.
It is also perfect, meaning that they are not written in the same way
The text of rtl1.txt was written directly into notepad and saved, while the text of rtl2.txt was copied from within the game, that is, after it was modified for this reason.
The rtl2txt text is the one that gives correct results inside the game screen, which are the results of the plugin. After copying it here on the site, the conjoined letters become from left to right, but when printed on the game screen, the conjoined letters become from right to left and are understandable.
Lev писал(а):
Answer this question: can you output text in a correct form in the HL sceen or not? You can try to insert text from rtl2.txt file right into the plugin file.
If no, probably it is not possible. And, BTW, use Steam version (or new non-steam) UTF support threre could be better.
Yes, I can. If I want to print the text inside the screen as it is, I have to save the plugin source with Encode in UTF-8 -BOM settings using Notepad++ because the AMXX-Studio program does not support these settings, I opened the file again using it, and the text appears in the ANSI setting, but the results appear in the game screen fine
This is with regard to printing specific text only. As for chatting, this requires only modification to letters and words
Yes, i'm already using game steam.
I just wanted to add a function in the plugin that enables me to ignore the last character of its substitution but it's hard to select after converting letters and words from right to left. I think it's possible but I don't have a way. :unknown:

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 12:50 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
27 апр 2024, 13:55
Сообщения: 6867
It is still hard for me to fully understand.
I have to get: text and bytes of the text that is correctly shown on the screen as you want it. And text and bytes that you get from the chat input (probably after RTL convertion you have olread wrote). Then we can figure out how to adjust the text for correct output.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 14:21 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
Well, these are two similar texts
rtl1.txt It is the text whose words contain the last letters correctly are what i want
Вложение:
rtl1.txt [51 байт]
Скачиваний: 41

rtl2.txt The ones whose words don't have valid last letters are what I get in the plugin
Вложение:
rtl2.txt [54 байт]
Скачиваний: 44

You can print it inside the screen. You will find the difference in the last letter of each word when counting the letters from right to left inside the game screen


"The problem is not in the text the problem is that the function replace_all in code it replaces all letters of the word only, and I want to specify that it replaces all letters of the word except for its last letter, because it is already spelled correctly
This process is just a correction of the shape of the letter according to its location in the word"


P.S:
For me, when I read what is inside the files, it gives the writing upside down from left to right, but it must be really like this in order to get a good result inside the screen (as if it were a trick or a hack or something like that)
Because when I want to write it in programs that support the Arabic language, for example, or websites, or in this forum or others, it is much easier and more correct than that

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 17:28 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
27 апр 2024, 13:55
Сообщения: 6867
I replaced extra letter in one word from the file to align bytes. Here what I got
Вложение:
rtl1.png
rtl1.png [ 2.16 КБ | Просмотров: 876 ]

Вложение:
rtl2.png
rtl2.png [ 1.94 КБ | Просмотров: 876 ]

Вложение:
rtl1-2.png
rtl1-2.png [ 26.51 КБ | Просмотров: 876 ]

You can notice that last letter in bad file is using code A3, and the one you wish use A2 or A1 - probably these are a bit differently connected letters. But I used one of them - A1 for replacement.
I copied rtl2.txt into rtl3.txt and replaced last letter in each word:
Вложение:
rtl3.png
rtl3.png [ 2.12 КБ | Просмотров: 876 ]

Вложение:
rtl2-3.png
rtl2-3.png [ 29.23 КБ | Просмотров: 876 ]

Вложение:
rtl2-3g.png
rtl2-3g.png [ 22.61 КБ | Просмотров: 876 ]

But there are still some differences from rtl1.txt (the one you wish to output)
Вложение:
rtl1-3.png
rtl1-3.png [ 22.93 КБ | Просмотров: 876 ]

These are other highlighted letters in first byte-to-byte comparision.
So I can suppose you can replace 0xEFBBA3 bytes with 0xEFBBA1 and 0xEFBB93 with 0xEFBB92. There can be other replacements (for example in first comparision), you should search yourself for them. I dunno why typing ingame or in some text editor gives different letters - you can search for that yourself.


Вложения:
rtl1.txt [51 байт]
Скачиваний: 41
rtl2.txt [51 байт]
Скачиваний: 41
rtl3.txt [51 байт]
Скачиваний: 41
Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 19:22 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
Yeah, I got the result by replacing the bytes!
 
This is the method I used, but in some words it replaces the letters from the middle of the word
Do I need to specify the position of the letter in the word (beginning - middle - end)?
What came to my mind is to determine the position of the character in the word and then replace the appropriate bytes after checking its position. Can it work? Or is there some way

--Will this information help me check and replace bytes?
https://en.wikipedia.org/wiki/Arabic_script_in_Unicode

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 16 июн 2023, 20:37 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
27 апр 2024, 13:55
Сообщения: 6867
To check word border you can search for 0x20 before, for ex. 0x20EFBBA3 (excluding string start position).
There can be other whitespace symbols, but probably you can rely on just "space".

abdobiskra писал(а):
--Will this information help me check and replace bytes?
https://en.wikipedia.org/wiki/Arabic_script_in_Unicode
Yes. For example 0xFEE3 (its \xEF\xBB\xA3) is used at the "Initial (Beginning)", 0xFEE2 (\xEF\xBB\xA2) at "Final (End)" and 0xFEE1 (\xEF\xBB\xA1) when "Isolated".
So I think you should replace to A2 at the word end.
With this info it is more clear why A3 was used - because that letter was at the beginning of the word before you reversed it.

To answer before you ask: https://www.compart.com/en/unicode/U+FE91
UTF-8 Encoding: 0xEF 0xBA 0x91
UTF-16 Encoding: 0xFE91


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 20 июн 2023, 00:14 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
Very good,
I did not succeed in determining the position of the letter if it was in the middle or the beginning of the word, but the end of the word, I think I already got it.

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: UTF-8 in Chat check letters
СообщениеДобавлено: 15 июл 2023, 23:47 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
23 апр 2024, 01:07
Сообщения: 1025
When writing a large line, the words at the end disappear. Can this be fixed?

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 21 ]  На страницу Пред.  1, 2, 3  След.

Часовой пояс: UTC + 5 часов [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 12


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
Создано на основе phpBB® Forum Software © phpBB Group
Русская поддержка phpBB