Questions tagged [char16-t]

The C++11 `char16_t` standard type represents a character in UTF-16 encoding.

36 questions
0
votes
0 answers

Performance issues with u_snprintf_u from libicu

I'm porting some application from wchar_t for C strings to char16_t offered by C++11. Although I have an issue. The only library I found that can handle snprintf for char16_t types is ICU with their UChar types. The performance of u_snprintf_u…
RitonLaJoie
  • 211
  • 3
  • 5
0
votes
0 answers

What is the relation between char ~ char32_t type and UTF-8 ~ UTF-32?

char: 8-bit character type char16_t: 16-bit character type char32_t: 32-bit character type wchar_t: 16 ~ 32-bit character type depending on the compiler   UTF-8: An encoding method that can represent Unicode characters while preserving 8-bit…
user3818260
0
votes
2 answers

Copy from char16_t* to char16_t*

I'm trying to copy a char16_t* that's passed into a function but haven't found any way to do that. foo(char16_t* characters) { char16_t* copiedCharacters; //copy characters to copiedCharacters } I tried to use strncopy() but it only copies…
Lenny
  • 388
  • 3
  • 15
0
votes
1 answer

Convert std::string to utf-16 (like u"some string"); Debugger tells "no suitable conversion exists"

Based on my previous question C++: Convert hex representation of UTF16 char into decimal (like python's int(hex_data, 16)) I would like to know how to convert a string into unicode for char16_t: As int main() { char16_t c = u'\u0b7f'; …
0
votes
0 answers

C++: fixed-size integer implementation for charX_t types

It is known to me that new character types were introduced in C++11. However, since C++11 is not available everywhere, it may be necessary to introduce char16_t and char32_t for everyone who wishes to work with UTF-16 and UTF-32. I've tried to…
ghostmansd
  • 3,285
  • 5
  • 30
  • 44
0
votes
0 answers

boost spirit and char16_t / UTF-16 support?

Is there any support, today or in the near future, for char16_t / UTF-16 in boost spirit? I did try the word count lexer example using char16_t but ran into al sorts of compile errors. Thanks, Henry Roeland
Henry Roeland
  • 492
  • 5
  • 19
1 2
3