Questions tagged [widechar]

widechar is a generic name for character sets wider than ASCII

The term widechar is a generic name for character sets wider than 8 bits. Generally this means some (unspecified) 16 or 32 bit Unicode encoding.

203 questions
2
votes
1 answer

Converting a hex string representation of a widechar codepoint to a widechar in Delphi

I am having trouble converting text within an edit box to a WideChar. This is being used in code for printing emoji characters. If I manually set the WideChar values like the following it works Emoji[1] := WideChar($D83D); Emoji[2] :=…
Some1Else
  • 715
  • 11
  • 26
2
votes
1 answer

Why can't I marshal UCS-4 strings properly in C#?

I am trying to marshal a hid_device_info struct in C#, but I can't figure out how to translate the wchar_t* strings to managed C# strings. I have tried all possible values in the MarshalAs attribute, but all of them returned the first character only…
Lázár Zsolt
  • 685
  • 8
  • 29
2
votes
2 answers

integer, printf: is there a way to write an integer as a wide char to console without locale.h?

suppose I have a Unicode codepoint c (a uint32). Is there a way to print this integer to console (as a wide character) without using locale.h or wchar.h? Thanks.
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217
2
votes
1 answer

Wide-character version of _memccpy

I have to concatenate wide C-style strings, and based on my research, it seems that something like _memccpy is most ideal (in order to avoid Shlemiel's problem). But I can't seem to find a wide-character version. Does something like that exist?
user12381459
2
votes
0 answers

Unreadable memory validation

I've got an wide char string , where the content of it is read from a rich edit control. Because the corrupted content of strKeyW, application lately crashes ; and unfortunately I can't check why exactly invalid data is written to it (the current…
2
votes
1 answer

Converting widechars to system ANSI encoding in Python

I am currently trying to make my screen reader work better with Becky! Internet Mail. The problem which I am facing is related to the list view in there. This control is not Unicode aware but the items are custom drawn on screen so when someone…
lukaszgo1
  • 33
  • 5
2
votes
1 answer

c, trimming strings, and wide characters

Briefly, I'm parsing HTTP headers, received from libcurl, in an environment where I need wide characters. The headers arrive to me as char * strings, in the general format name: value I'm separating this into two strings by writing a null into the…
Simon Brooke
  • 162
  • 2
  • 8
2
votes
0 answers

Correct way to print wide strings to terminals with different encodings

Below I will try to print string XЯ (latin "ex", cyrillic "ya", and Phoenician "teth") to terminals with various encodings, namely utf8, cp1251 and C (POSIX). I expect to see XЯ in utf8 terminal, XЯ? in cp1251 terminal, and X?? in C (POSIX)…
gudok
  • 4,029
  • 2
  • 20
  • 30
2
votes
3 answers

Convert Char into AnsiChar or WideChar (Delphi)

I'm upgrading a very old (10+ years) application to the latest Delphi XE. There are a number of errors I keep getting like Incompatible types: 'WideChar' and 'AnsiChar' I have been just casting the char to the right type: ex. AWideChar =…
Daisetsu
  • 4,846
  • 11
  • 50
  • 70
2
votes
2 answers

C with gcc and Portuguese Characters

I am trying to print and read from the windows console Portuguese character such as: ç , é and so on... #include #include #include #include int main (void){ wchar_t stringtemp[5]; …
2
votes
1 answer

How to cast to `wint_t` and to `wchar_t`?

Are the standards saying that casting to wint_t and to wchar_t in the following two programs is guaranteed to be correct? #include #include int main(void) { setlocale(LC_CTYPE, ""); wint_t wc; wc = getwchar(); …
Igor Liferenko
  • 1,499
  • 1
  • 13
  • 28
2
votes
2 answers

How to make std::wofstream write UTF-8?

I am redirecting std::wclog to a file for logging in my program: std::wclog.rdbuf((new std::wofstream("C:\\path\\to\\file.log", std::ios::app))->rdbuf()); Logging happens by writing to std::wclog: std::wclog << "Schöne Grüße!" <<…
Matthias Ronge
  • 9,403
  • 7
  • 47
  • 63
2
votes
2 answers

fwprintf omits wide chars

I'm trying to create wide chars file using MinGW C on Windows, however wide chars seem to be omitted. My code: const wchar_t* str = L"příšerně žluťoučký kůň úpěl ďábelské ódy"; FILE* fd = fopen("file.txt","w"); // FILE* fd =…
Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
2
votes
1 answer

c++ template and string literals

I want to create template function to parse regular or wide strings. Something like this: template bool parseString(std::basic_string str) { boost::basic_regex myRegex("my_regex_expression"); …
Victor Mezrin
  • 2,797
  • 2
  • 32
  • 48
2
votes
1 answer

C print wide chars in colors in iTerm2

I have a wide char wchar_t* string and I'd like to print it in color, with write(3) something like this: write(1, L"\x1b[31m", 5 * sizeof(wchar_t)); write(1, L"BLA", 3 * sizeof(wchar_t)); write(1, L"\x1b[0m", 5 * sizeof(wchar_t)); Prints [31mBLA[0m…
ItsASecret
  • 2,589
  • 3
  • 19
  • 32