Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Should I use L or U() when handling strings with JSON?

$
0
0
Hi DesktopMan,

In the C++ REST SDK we choose to use a different string type depending on the platform being targeted, example on Windows UTF-16. Some of our APIs support both UTF-8 and UTF-16, but the JSON library portions don't.

Many of the APIs take a string type of ::utility::string_t, which is different depending on the platform being targeted. For example it is a std::wstring holding UTF-16 on Windows and a std::string holding UTF-8 on Linux. The 'U' macro is a cross platform way to create a string literal for the platform. The 'L' is just the way to create a wide character literal. You can use this if you are writing code only for Windows.

Steve

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>