2

I have been looking for a C++ web framework with high performance target. I found out it, I am not sure that does it support Unicode because I see some its samples use std:string for render. Does any one use it with Unicode output?

1 Answers1

3

By unicode, I assume you mean UTF-8.

Yes, cppcms fully support UTF-8. I am from the ROC (Republic of China) and I use cppcms to output Chinese Traditional characters. On the cppcms mailing list, there are also many people from the PRC (People's Republic of China) and they use it with Simplified Chinese caracters. You won't have any problem for Vietnamese.

Check the wiki page for Encoding and UTF-8:
http://cppcms.com/wikipp/en/page/cppcms_1x_encoding_and_utf8

Basically, in your config.js file, make sure to properly declare your locale, e.g.:

"localization" : {  
    "locales" : [ "en_US.UTF-8" ]  
}  

Also, if you use mysql, make sure to declare the encoding in the database connection string, like this:

    mysql:host=127.0.0.1;database=foo;user=bar;password=foobar;set_charset_name=utf8

That's basically it. With that, you can use std::wstring or anything you wish.

augustin
  • 14,373
  • 13
  • 66
  • 79
  • Please add a colon between "localization" and "{". Otherwise this is not correct JSON and the application doesn"t work. – Kağan Kayal May 18 '15 at 20:16
  • @TrìnhCông If this answer solved your question please mark it as the correct answer :) – ZN13 Aug 13 '17 at 10:30