Похожие чаты

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

26 просмотров

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.

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта