Похожие чаты

Hi I want send text message to socket. what type of

vector buffer is fine ?
I want to set any language to buffer.
such as Arabic and English.
how set unicode to string .

for example:
std::string txt = " سلام hi "
socket.sendMessage(txt);

14 ответов

22 просмотра

Arabic characters supported in UTF-16 not in UTF-8 and string is a typedef of basic_string<char> and it is takes only one byte . Instead , use std::u16string txt = u”وعليكم السلام”;

...- Автор вопроса
Abdulrhman Alhazmi
Arabic characters supported in UTF-16 not in UTF-8...

What type of string Is general for all language? if I want this " السلام hi "

...- Автор вопроса
Abdulrhman Alhazmi
Arabic characters supported in UTF-16 not in UTF-8...

I working on a message server And I need support all languages

...
What type of string Is general for all language? ...

main types to deal with unicode char -> for utf8 char16_t -> utf16 char32_t -> utf32 wchat_t -> it size maybe different ( 2 bytes or 4 byes ) use sizeof(wchat_t) i think all languages are supported utf16,utf32

...- Автор вопроса

what is wrong with std::string in this case?

Déjà vu
utf8 supports arabic

i know that you can encode any codepoints of UTF16 or UTF32 in UTF8 which will handle everything possible in unicode .

Déjà vu
what is wrong with std::string in this case?

It will show error I think since string can’t hold one codepoints of multibytes ! but using auto txt = u8”arabic ع”; on windows i always prefer to use wchar_t which will handle arabic characters well, than just encoded it in utf8

...- Автор вопроса
Déjà vu
what is wrong with std::string in this case?

I want store string to vector<char> for sending but char is 1 byte

for sending what?

and those socket send recieve syscalls and related api functions also does not care about encoding they just are caring about bytes.

Похожие вопросы

Обсуждают сегодня

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
16
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
any reference of this implementation?
BitBuddha
29
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Карта сайта