Roig
(Roig)
1
I want to store a string with an accent like “aà” to an FString.
Doing this:
FString a = TEXT("aà");
I’m getting those errors:
error C2018: unknown character '0x22'
error C2018: unknown character '0x29'
error C3688: invalid literal suffix 'a")GGABLE'; literal operator or literal operator template 'operator ""
Anyone can explain me how to do it correctly? Thank you!
Sorry i’m not so good at this but…
FString a = TEXT("a\x00e0");
where \x00e0 utf-8 character code
you can use “u” too
Numeric character references:
- \ + up to 3 octal digits
- \x + any number of hex digits
- \u + 4 hex digits (Unicode BMP, new in C++11)
- \U + 8 hex digits (Unicode astral planes, new in C++11)
Roig
(Roig)
4
Thank you! that worked! But, can you explain me why is the \x ?
I found this website:
And it says to use \u instead of \x. Do you know if there are some differences?
Roig
(Roig)
5
According to c++ spec:
https://en.cppreference.com/w/cpp/language/escape
For unicode you will have to use /u not /x