wstring Questions

4

I would like to convert wstring to wchar_t*. I have tried everything what i know, please help. I would like to convert wstring to wchar_t*.
Singularity asked 8/7, 2017 at 11:2

10

Solved

I have a wstring declared as such: // random wstring std::wstring str = L"abcàdëefŸg€hhhhhhhµa"; The literal would be UTF-8 encoded, because my source file is. [EDIT: According to Mark Ransom t...
Vierra asked 29/10, 2010 at 16:31

21

Solved

The question is how to convert wstring to string? I have next example : #include <string> #include <iostream> int main() { std::wstring ws = L"Hello"; std::string s( ws.begin(), ws...
Redeemable asked 26/1, 2011 at 11:58

14

I am not able to understand the differences between std::string and std::wstring. I know wstring supports wide characters such as Unicode characters. I have got the following questions: When shou...
Shelby asked 31/12, 2008 at 4:8

20

string s = "おはよう"; wstring ws = FUNCTION(s, ws); How would i assign the contents of s to ws? Searched google and used some techniques but they can't assign the exact content. The content is dist...
Unreason asked 4/4, 2010 at 7:35

8

Solved

I need to convert between wstring and string. I figured out, that using codecvt facet should do the trick, but it doesn't seem to work for utf-8 locale. My idea is, that when I read utf-8 encoded ...
Autoradiograph asked 5/12, 2010 at 12:52

4

Solved

I am writing a program that needs to be able to work with text in all languages. My understanding is that UTF-8 will do the job, but I am experiencing a few problems with it. Am I right to say tha...
Wartburg asked 20/8, 2012 at 15:25

11

Solved

I am using std::string's find() method to test if a string is a substring of another. Now I need case insensitive version of the same thing. For string comparison I can always turn to stricmp() but...
Vasectomy asked 30/6, 2010 at 18:28

7

How can I read a Unicode (UTF-8) file into wstring(s) on the Windows platform?
Harlow asked 23/1, 2011 at 18:4

5

Solved

I had the code: std::string st = "SomeText"; ... std::cout << st; and that worked fine. But now my team wants to move to wstring. So I tried: std::wstring st = "SomeText"; ... std::cout &...
Corcovado asked 9/1, 2012 at 11:56

3

Solved

I want to convert wstring to u16string in C++. I can convert wstring to string, or reverse. But I don't know how convert to u16string. u16string CTextConverter::convertWstring2U16(wstring str) {...
Sailmaker asked 11/3, 2017 at 11:38

6

Solved

I know that there are already several questions on StackOverflow about std::string versus std::wstring or similar but none of them proposed a full solution. In order to obtain a good answer I sho...
Signore asked 10/1, 2010 at 17:13

5

Solved

I programmed a little Application in C++. There is a ListBox in the UI. And I want to use the selected Item of ListBox for an Algorithm where I can use only wstrings. All in all I have two questio...
Yahoo asked 26/12, 2012 at 23:7

2

Solved

I have a file that contains text, I would like to get each line from this file into a std::wstring variable.If I do this I get an error, so is it possible to use std::wstring or I'm obligate to use...
Tengler asked 19/11, 2015 at 14:26

1

Solved

My simple code has no trouble with Japanese characters when outputting, but for some reason it doesn't take input properly, is it lacking something? int main() { _setmode(_fileno(stdout), _O_U16TE...
Browder asked 16/9, 2020 at 14:52

1

Solved

My main platform is Windows which is the reason why I use internally UTF-16 (mostly BMP strings). I would like to use console output for these strings. Unfortunately there is no std::u16cout or st...
Minnich asked 20/4, 2020 at 13:19

2

SUMMARY How can I write a zip file using libarchive in C++, such that path names will be UTF-8 encoded? With UTF-8 path names, special characters will be decoded correctly when using OS X / Linux ...
Neral asked 3/12, 2014 at 9:31

4

Solved

How can I convert from CString to std::wstring?
Uncomfortable asked 11/1, 2010 at 10:44

2

Solved

Consider this function to convert narrow strings to wide strings: std::wstring convert(const std::string& input) { try { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> c...
Griceldagrid asked 5/4, 2018 at 9:38

4

Solved

I have Windows registry key value in wstring format. Now I want to pass it to this code (first argument - path to javaw.exe): std::wstring somePath(L"....\\bin\\javaw.exe"); if (!CreateProcess("...
Summertime asked 23/3, 2014 at 0:3

1

Solved

Some information: I've only tried this on Linux I've tried both with GCC (7.2.0) and Clang (3.8.1) It requires C++11 or higher to my understanding What happens when I run it I get the expected...
Salvation asked 24/8, 2017 at 20:59

1

Solved

This question shows how to split a string into a vector using a single character delimeter. Question: Right way to split an std::string into a vector However, applying this technique to wstring i...
Hyponasty asked 23/4, 2016 at 14:34

6

Solved

I am having this std::string which contains some characters that span multiple bytes. When I do a substring on this string, the output is not valid, because ofcourse, these characters are counted ...
Sole asked 1/6, 2012 at 8:34

6

Solved

What's the best way to convert std::wstring to numeric type, such as int, long, float or double?
Doge asked 25/2, 2011 at 14:20

4

Solved

I am using std::wstring as my Unicode style string. Now I want to get the byte size of a wstring. If I use size() method of wstring, I just get the total number of chars in my wstring. But the b...
Thyestes asked 14/2, 2012 at 14:36

© 2022 - 2024 — McMap. All rights reserved.