Questions tagged [widestring]

109 questions
1
vote
2 answers

How to deal with the Unicode characters in C++

We have a commenting system built into our engine that allows programmers to put comments for various exposed variables/objects which are then used by the GUI front-end for tool-tips and help. Recently, certain tool-tips started crashing, and after…
Samaursa
  • 15,249
  • 20
  • 77
  • 150
1
vote
1 answer

Converting a wstring to jstring on Linux

I'm having problems converting a wstring to jstring in unix, as the size of wchar_t on linux in 4 bytes (not 2 bytes like windows and thus I cannot use the casting of a wchar_t to a jchar). Can anyone please help me with that? Thanks, Reza
RezaPlusPlus
  • 495
  • 1
  • 8
  • 17
1
vote
1 answer

how to correctly format WideString using sprintf or wprintf

I am using this code to format WideString but with no success! It prints unexpecting results :( here is my code WideString s; dep=new TStringList(); while(!DM->tDepPln->Eof) { //where tDepPlnFltNo is mysql field type of WideString …
Suhrob Samiev
  • 1,478
  • 1
  • 24
  • 55
1
vote
3 answers

Typographic apostrophe + wide string literal broke my wofstream (C++)

I’ve just encountered some strange behaviour when dealing with the ominous typographic apostrophe ( ’ ) – not the typewriter apostrophe ( ' ). Used with wide string literal, the apostrophe breaks wofstream. This code works ofstream…
singinanarchist
1
vote
0 answers

How does MSVC's STL open an fstream with a wide string filename?

Possible Duplicate: Opening fstream with file with Unicode file name under Windows using non-MSVC compiler I have been trying to find a simple way to open a file with non-ASCII characters in its filename in Windows with GCC. Microsoft's STL…
rubenvb
  • 69,525
  • 30
  • 173
  • 306
1
vote
1 answer

Pantheios wide characters?

I'm trying to integrate logging into my Windows C++ application, and I wanted to use Pantheios, as it generally has very favorable comments. That said, all the examples included are using macros like PANTHEIOS_LITERAL_STRING etc., for wrapping…
Mike Hornblade
  • 1,414
  • 2
  • 14
  • 19
1
vote
0 answers

Is passing a (Unicode) string to a WideString parameter safe?

Is it safe to pass a Delphi (Unicode) string to a procedure as a parameter of type WideString? procedure Test; var S: string; Html: string; begin S := '...'; // may contain anything a Unicode string accepts Html :=…
mjn
  • 35,561
  • 24
  • 160
  • 351
1
vote
2 answers

Using narrow string manipulation functions on wide data

I'm parsing an XML file which can contain localized strings in different languages (at the moment its just english and spanish, but in the future it could be any language), the API for the XML parser returns all data within the XML via a char* which…
Gruntcakes
  • 36,166
  • 41
  • 170
  • 346
1
vote
0 answers

A try to convert from char* to wchar_t* but doesn't work with non-English languages

I want to convert a string from char* to wchar_t* but that string is any language other than English for example (Russian, Chinese, Arabic, etc). I have tried to do that by the following: // This is just an example of conversion const wchar_t *…
Lion King
  • 28,712
  • 21
  • 69
  • 128
1
vote
0 answers

How to convert unicode strings to respective locale strings in cpp

I am reading unicode string from an XML file in C++ program and when i print the string i get the unicode printed as plain text instead of the decoded locale string.I initially tried it with plain string and then used widestring for decoding .Here…
user1
  • 53
  • 8
1
vote
1 answer

What is the issue in following conversion from argv[1] to char * string?

I am very new to C and pointers. I am trying to convert command line argument to wchar_t * . But somehow it is not giving proper output. What am I missing? void fun(){ std::setlocale(LC_ALL, "en_US.utf8"); …
1
vote
2 answers

wscanf() behaving differently than scanf() when taking input

I have a simple program which takes user input as a string and output the entered string. The only difference is that I have provided two option to the user, First to input a basic string. Second to input a wide string. The scanf() successfully…
Prateek Joshi
  • 3,383
  • 3
  • 34
  • 45
1
vote
0 answers

Why can't I convert a multibyte string to a wide string? mbsrtowcs fails with EILSEQ even though the mbstring seems valid

Please see this snippet I wrote that is supposed to simply convert a multibyte string (which it gets from stdin) to a wide string. Having read the mbsrtowcs and mbstate_t documentation from cppreference I thought it was valid: #include…
user4385532
1
vote
1 answer

Access Violation when trying to create class with wide string

Im making a code which is supposed to read a debug log, parse the log, and activate a google text-to-speech which will give info about the game that spits it out. The log has UTF-8 encoding, so im using wide strings in the code, the code compiles,…
OptoCloud
  • 55
  • 6
1
vote
1 answer

How to read a "wide" string into a buffer?

The Windows API has functions like GetWindowTextW that read a string into a buffer you provide. How do I provide such a buffer and then read a string from it in Rust? P.S. In contrast to this question Calling the GetUserName WinAPI function with a…
VasiliNovikov
  • 7,845
  • 2
  • 38
  • 49