I tested this but it won’t work. The foreign characters get lost.
char message [] = "stringtobesendedwithforeigncharacters도쿄";
t = 39;
while(curler < t) {
r = send(sockfd, message, t, 0);
if(r > 0) {
curler += r;
}
}
What’s the easiest way to do this?
You have a typo in
messagedeclaration and you assign incorrect size totas other guys have already pointed out.This article will maybe help you: Unicode in C and C++: What You Can Do About It Today