Похожие чаты

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 ответов

6 просмотров

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”وعليكم السلام”;

ali- Автор вопроса
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 "

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

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

ali
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

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

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

ali- Автор вопроса
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.

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

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

Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
We heading to 1.1$ 🤔?
CryptoBo$$
35
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
45
Всем здравствуйте!) У меня такой вопрос. Есть два роута, роут1 и роут2. Они связаны с очередью some_queue. По задаче предполагается, что есть два паблиша. Паблиш1 отправляет...
Format
10
i justHey. Im holding kadena almost 3 years now. Its my only investment what isn't in profit. But i thought for years that its just need some more time but i haven't seen that...
Riki
6
Сonst magicTgHTML = (text, entities) => { let processedText = text; let offsetShift = 0; entities.forEach(entity => { const { offset, length, type, url, ...
Андрей
1
Вопрос по WIN32: Насколько я понимаю то все функции win32 привязаны к объектам операционной системы. Например консоль, файл, кисть, окна итд. Следовательно функции win32 упра...
Tommy Vercetti
6
remote nodes with vpn or tor still safe ? (or they can collect other information like amount, receiving/sending adress, .. ?)
Tchoupi
11
кто-то пользуется компонентами rx ? как их лучше ставить, через OPM? (lazarus)
Iluha Companets
15
В смысле более затратная? Общая стоимость владения лошадью меньше, чем автомобиля. В среднем.
Sergej R
10
Карта сайта