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
0
votes
1 answer

Arrow Keys as Wide Chars

I am trying to determine if it is possible to take arrow keys and convert them to wide characters. I am using conio.h for its getch() function, I just like how it works compared to similar functions, and it has to be called twice to retrieve arrow…
Josh C
  • 1,035
  • 2
  • 14
  • 27
0
votes
1 answer

Write encrypted wstring to wofstream

I have a simple "encryption" function that works with wstring variables and I want to write the result of this function into a file, using wofstream. This is my code: void save_file() { wstring text = L"Text to be encrypted. The text is…
ali
  • 10,927
  • 20
  • 89
  • 138
0
votes
1 answer

C standard: L prefix and octal/hexadecimal escape sequences

I didn't find an explanation in the C standard how do aforementioned escape sequences in wide strings are processed. For example: wchar_t *txt1 = L"\x03A9"; wchar_t *txt2 = L"\xA9\x03"; Are these somehow processed (like prefixing each byte with…
user206334
  • 850
  • 1
  • 8
  • 18
0
votes
2 answers

How to let File::Queue to be able to process utf8 strings in perl?

I'm processing some data from XML files in perl and wanna use the FIFO File::Queue to divide and speed up the process. One perl script parses the XML file and prepares JSON output for another script: #!/usr/bin/perl -w binmode STDOUT, ":utf8"; use…
TomekK
  • 3
  • 1
0
votes
2 answers

C++ Unicode Issue

I'm having a bit of trouble with handling unicode conversions. The following code outputs this into my text file. HELLO??O std::string test = "HELLO"; std::string output; int len = WideCharToMultiByte(CP_OEMCP, 0, (LPCWSTR)test.c_str(), -1, NULL,…
jacobsgriffith
  • 1,448
  • 13
  • 18
0
votes
1 answer

Buffer overrun when running in debug mode

When running our game in debug-mode I get a buffer overrun crash - the callstack is bananas (looks like it's stuck in a recursive loop) however I tracked the crash to the following function: std::wstring formatWstring(const wchar_t *first, ...) { …
0
votes
2 answers

why does wcslen count 1 extra character on argv[1]?

argv[1] seems to return 1 extra character than what is input. argv[2] is correct. #include int main(int argc, wchar_t *argv[]) { printf("%d %d\n",wcslen(argv[1]),wcslen(argv[2]) ); return 0; } I'm using mingw32 to compile. I compile…
user922475
0
votes
1 answer

How to convert java strings to wide character strings using JNI

Several months ago, I wrote a Java API that use JNI to wrap around a C API. The C API used char strings and I used GetStringUTFChars to create the C strings from the Java Strings. I neglected to think through the problems that might arise with…
RobWills
  • 3
  • 1
  • 3
0
votes
1 answer

is it possible to overload wcout << operator to substitute it with WriteConsoleW?

The thing is that MinGW compiled program has problems with printing non-ascii chars on console through wcout, the output may show characters from different codepage or be completely blank. But winapi WriteConsoleW works perfectly. So I ask if there…
rsk82
  • 28,217
  • 50
  • 150
  • 240
0
votes
0 answers

Android Crystax NDK wide character functions in static library

I use Crystax NDK and I have 2 make files that produce a static library (libA.a) and a shared library (libB.so). Module B is dependent on module A (which is reflected by LOCAL_STATIC_LIBRARIES in B's make file). In module A's code I have a call to…
Tim
  • 51
  • 7
0
votes
1 answer

C++ Builder XE2: How to convert String to a wchar_t*

I have the SHBrowseForFolder to popup and work fine, but I would like to set the Title. I know it has to be a wchar_t* and when I use a const like (wchar_t*)L"My Title" the title is shown correct. But if I try to use a String value I only get the…
Max Kielland
  • 5,627
  • 9
  • 60
  • 95
0
votes
2 answers

Copy a multi-string into a buffer

I'm using a windows-api that returns a wide-char multi-string as result. The result is same as below: L"apple\0banana\0orange\0\0" Is there any standard function or good performance solution to copy this structure to a…
masoud
  • 55,379
  • 16
  • 141
  • 208
-1
votes
1 answer

How to I get the contents from a wchar_t array into a LPWSTR?

I found a very old post, which gives the answer as: LPCWSTR is a pointer to a const string buffer. LPWSTR is a pointer to a non-const string buffer. Just create a new array of wchar_t and copy the contents of the LPCWSTR to it and use it in the…
CDv
  • 1
  • 1
-1
votes
1 answer

Wide string command line arguments in C

I'm writing a program that what it does first, is to retrieve the first command line argument (which should be a process name), and find the corresponding PID of the process. Here's how I do it: in main DWORD PID = FindProcessId(argv[1]); and…
nortain32
  • 69
  • 1
  • 7
-1
votes
1 answer

wchar_t user input with spaces

Im currently using wchar_t for a username, however, I'm having an issue when the username contains a space when using std::wcout as it will just get the first word typed. I am aware of getline for when your user input contains a space but I can't…
Kryton
  • 95
  • 1
  • 5
1 2 3
13
14