#include <iostream>
#include <string>
#include <vector>
/** /
class UnicodeOne {
public:
bool Parse(const std::uint8_t& High, const std::uint8_t& Mid,const std::uint8_t& Low) {
std::uint16_t L = 0;
std::uint8_t H = 0;
L = Low + (Mid << 8);
}
protected:
std::uint16_t Low = 0;
std::uint8_t High = 0;
};
/**/
int main() {
std::locale L("Japanese");
std::locale l("", std::locale::ctype);
auto LR = std::wcout.imbue(l);
std::uint8_t S[] = u8"あ";
std::uint8_t Z[4] = {};
Z[0] = S[1];
Z[1] = S[0];
Z[2] = S[2];
Z[3] = S[3];
std::wcout << S << std::endl;
std::wcout << Z << std::endl;
std::wcout << u8"あ" << std::endl;
std::wcout.imbue(LR);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgoKLyoqIC8KY2xhc3MgVW5pY29kZU9uZSB7CnB1YmxpYzoKCglib29sIFBhcnNlKGNvbnN0IHN0ZDo6dWludDhfdCYgSGlnaCwgY29uc3Qgc3RkOjp1aW50OF90JiBNaWQsY29uc3Qgc3RkOjp1aW50OF90JiBMb3cpIHsKCQlzdGQ6OnVpbnQxNl90IEwgPSAwOwoJCXN0ZDo6dWludDhfdCBIID0gMDsKCgkJTCA9IExvdyArIChNaWQgPDwgOCk7Cgl9Cgpwcm90ZWN0ZWQ6CglzdGQ6OnVpbnQxNl90IExvdyA9IDA7CglzdGQ6OnVpbnQ4X3QgSGlnaCA9IDA7Cn07Ci8qKi8KaW50IG1haW4oKSB7CgoJc3RkOjpsb2NhbGUgTCgiSmFwYW5lc2UiKTsKCXN0ZDo6bG9jYWxlIGwoIiIsIHN0ZDo6bG9jYWxlOjpjdHlwZSk7CgoJYXV0byBMUiA9IHN0ZDo6d2NvdXQuaW1idWUobCk7CgoJc3RkOjp1aW50OF90IFNbXSA9IHU4IuOBgiI7CglzdGQ6OnVpbnQ4X3QgWls0XSA9IHt9OwoKCVpbMF0gPSBTWzFdOwoJWlsxXSA9IFNbMF07CglaWzJdID0gU1syXTsKCVpbM10gPSBTWzNdOwoKCXN0ZDo6d2NvdXQgPDwgUyA8PCBzdGQ6OmVuZGw7CglzdGQ6Ondjb3V0IDw8IFogPDwgc3RkOjplbmRsOwoJc3RkOjp3Y291dCA8PCB1OCLjgYIiIDw8IHN0ZDo6ZW5kbDsKCglzdGQ6Ondjb3V0LmltYnVlKExSKTsKCglyZXR1cm4gMDsKCn0=
prog.cpp: In function ‘int main()’:
prog.cpp:24:38: error: no matching function for call to ‘std::locale::locale(const char [1], const category&)’
std::locale l("", std::locale::ctype);
^
In file included from /usr/include/c++/8/bits/ios_base.h:41,
from /usr/include/c++/8/ios:42,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:1:
/usr/include/c++/8/bits/locale_classes.h:340:5: note: candidate: ‘std::locale::locale(std::locale::_Impl*)’
locale(_Impl*) throw();
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:340:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/locale_classes.h:206:7: note: candidate: ‘template<class _Facet> std::locale::locale(const std::locale&, _Facet*)’
locale(const locale& __other, _Facet* __f);
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:206:7: note: template argument deduction/substitution failed:
prog.cpp:24:38: note: mismatched types ‘_Facet*’ and ‘int’
std::locale l("", std::locale::ctype);
^
In file included from /usr/include/c++/8/bits/ios_base.h:41,
from /usr/include/c++/8/ios:42,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:1:
/usr/include/c++/8/bits/locale_classes.h:192:5: note: candidate: ‘std::locale::locale(const std::locale&, const std::locale&, std::locale::category)’
locale(const locale& __base, const locale& __add, category __cat);
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:192:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/8/bits/locale_classes.h:177:5: note: candidate: ‘std::locale::locale(const std::locale&, const string&, std::locale::category)’
locale(const locale& __base, const std::string& __s, category __cat)
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:177:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/8/bits/locale_classes.h:163:5: note: candidate: ‘std::locale::locale(const string&)’
locale(const std::string& __s) : locale(__s.c_str()) { }
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:163:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/locale_classes.h:151:5: note: candidate: ‘std::locale::locale(const std::locale&, const char*, std::locale::category)’
locale(const locale& __base, const char* __s, category __cat);
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:151:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/8/bits/locale_classes.h:137:5: note: candidate: ‘std::locale::locale(const char*)’
locale(const char* __s);
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:137:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/locale_classes.h:126:5: note: candidate: ‘std::locale::locale(const std::locale&)’
locale(const locale& __other) throw();
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:126:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/locale_classes.h:117:5: note: candidate: ‘std::locale::locale()’
locale() throw();
^~~~~~
/usr/include/c++/8/bits/locale_classes.h:117:5: note: candidate expects 0 arguments, 2 provided