elcuco : |
אחסון זאת לא בעייה זה שקוף.
תצוגה - תלוי ב-toolkit שלך, אבל בגדול מאוד, כולם מתמודדים עם זה. אתה זורק את העברית לפקד המתאים (textedit - inputline - label ומה שלא יהיה) וזה מוצג. אם אתה צריך לדעת משהו יותר נמוך, כמו איפה המקום הויזואלי של תו לוגי (זה תלוי בכיווניות של הפסקא ולא רק בתוכן או הגופן). יש כמה מנועים שמשובצים בכל toolkit שנותנים לך מענה. בקיצור - זה לא חלק מהשפה. אבל רב הזמן זה עובד שקוף. מה אתה צריך לעשות בדיוק? |
קוד: |
char x ='y' cout << x |
קוד: |
char x ='ע' cout << x |
קוד: |
wchar_t x ='ע'
cout << x |
קוד: |
std::string s =u8"ע"
cout << s |
borsood : | ||||
זה בטוח לא יעבוד. ++C עדיין לא מגדירה יוניקוד היטב.
האפשרויות הן:
או יותר טוב:
|
קוד: |
wchar_t x ='ע';
cout << x << endl; |
קוד: |
warning: multi-character character constant [-Wmultichar]. |
קוד: |
std::string s=u8"ע";
cout << s; |
קוד: |
error: ‘u8’ was not declared in this scope
error: expected ‘,’ or ‘;’ before string constant |
קוד: |
--std=c++11 |
קוד: |
wchar_t x ='ע';
wcout << x << endl; |
קוד: |
? |
קוד: |
wchar_t x =150000; for (;x>=0;x--) if (x=='ע') wcout << x << endl; |
קוד: |
std::string s=u8"ע";
cout << s; |
קוד: |
#include <iostream>
int main() { wchar_t w = L'ע'; std::wcout << w << std::endl; return 0; } |
קוד: |
#include <iostream>
#include <string> int main() { std::string s = u8"🤦" ; std::cout << s << '\n'; return 0; } |