widestring Questions

5

Solved

I found a Windows API function that performs "natural comparison" of strings. It is defined as follows: int StrCmpLogicalW( LPCWSTR psz1, LPCWSTR psz2 ); To use it in Delphi, I declared it thi...
Martin asked 21/6, 2009 at 18:50

5

Solved

Can we use the wmain() function with Unix compilers or it'll work only on/for Windows?
Showboat asked 13/3, 2010 at 12:25

6

I want to display an Arabic message mixed with Chinese using wcout. The following code is OK: #include <iostream> using namespace std; int main() { wcout.imbue(locale("chs")); wcout &lt...
Fibroblast asked 4/2, 2013 at 16:34

2

Solved

I have a macro for a character string as follows: #define APPNAME "MyApp" Now I want to construct a wide string using this macro by doing something like: const wchar_t *AppProgID = APPNAME L".D...
Throwback asked 6/11, 2009 at 20:13

1

Solved

I have a dll and a test application written in Delphi. The test application uses multiple threads to call the function exported by the dll. The exported function has a trivial thread safe implement...
Ormolu asked 19/3, 2018 at 8:47

4

Solved

I'm using swprintf to build a string into a buffer (using a loop among other things). const int MaxStringLengthPerCharacter = 10 + 1; wchar_t* pTmp = pBuffer; for ( size_t i = 0; i < nNumPlaye...
Punchdrunk asked 1/6, 2010 at 8:50

2

Solved

I am modernizing a large, legacy MFC codebase which contains a veritable medley of string types: CString std::string std::wstring char* wchar_t* _bstr_t I'd like to standardize on a single stri...
Finbur asked 31/8, 2017 at 14:12

1

Solved

I have a program that utilizes a Windows API via a C FFI (via winapi-rs). One of the functions expects a pointer to a pointer to a string as an output parameter. The function will store its result ...
Contumelious asked 16/9, 2016 at 15:5

3

Solved

I understand what it does: specifies a string literal as a const wchar_t * (wide character string) instead of const char * (plain old characters), but how is it actually defined? Is it a macro of ...
Dendritic asked 26/10, 2012 at 12:48

2

Solved

I'm curious about what happens with this piece of code in Delphi 2010: function foo: WideString; var myUnicodeString: UnicodeString; begin for i:=1 to 1000 do begin myUnicodeString := ... so...
Ajani asked 15/8, 2013 at 13:41

2

Solved

Just found out that all of the following work: printf( "%ls\n", "123" L"456" ); printf( "%ls\n", L"123" "456" ); printf( "%ls\n", L"123" L"456" ); The output is 123456 123456 123456 Why can I...
Door asked 7/8, 2013 at 11:42

1

Solved

David's answer to another question shows a Delphi DLL function returning a WideString. I never thought that was possible without the use of ShareMem. My test DLL: function SomeFunction1: Widestri...
Surpass asked 17/2, 2012 at 15:32

2

Solved

Is there a handy Format() function that works only on Ansi strings? Because everytime I use an AnsiString with Format() I get a warning. And no, I don't want Delphi to convert my AnsiStrings back a...
Fluoridate asked 7/10, 2011 at 3:58

3

Solved

i am trying to construct a (test) WideString of: á (U+00E1 Small Letter Latin A with acute) but using it's decomposed form: LATIN SMALL LETTER A (U+0061) COMBINING ACUTE ACCENT (U+0301) S...
Canthus asked 11/8, 2011 at 16:12

2

Solved

Under Delphi 2010 (and probably under D2009 also) the default string type is UnicodeString. However if we declare... const s :string = 'Test'; ss :string[4] = 'Test'; ... then the first strin...
Immitigable asked 25/1, 2011 at 13:52

4

Solved

Code Segment 1: wchar_t *aString() { wchar_t *str = new wchar[5]; wcscpy(str, "asdf\0"); return str; } wchar_t *value1 = aString(); Code Segment 2 wstring wstr = L"a value"; wchar_t *value ...
Cogan asked 6/8, 2010 at 14:55

1

Solved

My code is basically this: wstring japan = L"日本"; wstring message = L"Welcome! Japan is "; message += japan; wprintf(message.c_str()); I'm wishing to use wide strings but I do not know how the...
Oswell asked 28/6, 2010 at 6:13

2

Solved

We're currently converting a Delphi 2007 project to Delphi 2010. We were already using Unicode (via WideStrings and TNT Unicode Controls). I was expecting to replace all Wide functions, e.g. WideU...
Monjo asked 23/4, 2010 at 2:10

4

Solved

How do I convert a wchar_t string from upper case to lower case in C++? The string contains a mixture of Japanese, Chinese, German and Greek characters. I thought about using towlower... http:/...
Dustan asked 23/10, 2009 at 16:37

4

Solved

I'm using Delphi7 (non-unicode VCL), I need to store lots of WideStrings inside a TFileStream. I can't use TStringStream as the (wide)strings are mixed with binary data, the format is projected to ...
Nashner asked 30/8, 2009 at 15:20
1

© 2022 - 2024 — McMap. All rights reserved.