Questions tagged [widestring]

112 questions
1
vote
3 answers

widestring compatibility problem in Delphi

In a dll build with Delphi 2006 Foo(aPath: widestring); begin _rootPath := aPath; end; In an executable built with Delphi 2010 _Foo := GetProcAddress(FooModule,’Foo’); _Foo(‘123456’); Stepping into the dll, aPath = '123'. In fact any string I…
DaiKiraii
  • 43
  • 4
1
vote
2 answers

C++ L"whatever" -> wstring -> basic_string

I'm writing a "string splitter" for a parser, and i want to be able to use both char and wchar_t. I have the following method : static void tokenize(const basic_string &, vector &); And i would like to give it a wide string to parse…
Virus721
  • 8,061
  • 12
  • 67
  • 123
1
vote
4 answers

Case insensitive search in Unicode in C++ on Windows

I asked a similar question yesterday, but recognize that i need to rephase it in a different way. In short: In C++ on Windows, how do I do a case-insensitive search for a string (inside another string) when the strings are in unicode format (wide…
Nitramk
  • 1,542
  • 6
  • 25
  • 42
1
vote
1 answer

how to convert single-byte string to wide string in c++?

I know the encoding and that the input string is 100% single byte, no fancy encodings like utf etc. And all I want is to convert it to wchar_t* or wstring basing on a known encoding. What functions to use ? btowc() and then loop ? Maybe string…
rsk82
  • 28,217
  • 50
  • 150
  • 240
1
vote
1 answer

How to unescape an escaped wide string in Delphi?

Some of my wide strings contains characters escaped with &# For example: The wide string source looks like: ' ' The converted result must be ' ' (3 blank spaces). Function should look like function UriUnescape(const aSrc:…
mas_oz2k1
  • 2,851
  • 3
  • 34
  • 41
1
vote
1 answer

Copy files with widestring path in C++

I'm having some trouble using wchar_t* strings for copying a file, how do I open them in C/C++ I need to use wide chars because the filenames are in unicode with different foreign languages. Thanks in advance.
user149292
1
vote
1 answer

Program crashes as soon as I use widestring in C++

(Since I don't have enough reputation to answer my own question just yet, I'm gonna put it here first. I wasn't thinking straight when I posted it. It was 3AM for me, didn't occur to me to look elsewhere for the problem. I was making another…
Stanley Wu
  • 11
  • 2
0
votes
0 answers

send data using Indy component as WideString with Delphi

I'm using Delphi 6 for developing a client/server application using Indy and COM components, and the response was sent in XML format as a WideString variable. I'm facing an EOutOfMemory exception when the response data was more than 2 GB or 2^30…
0
votes
1 answer

Are there other ways to specify or enter a Unicode code point in C other than using string literals?

In the following program I am trying to provide a Unicode code point to the ncurses function setcchar() as an array string instead of as a string literal. However the output that I'm getting is the first character of the array only, namely the…
0
votes
2 answers

wcout does not output as desired

I've been trying to write a C++ application for a project and I ran into this issue. Basically: class OBSClass { public: wstring ClassName; uint8_t Credit; uint8_t Level; OBSClass() : ClassName(), Credit(), Level() {} …
Yahya Gedik
  • 97
  • 1
  • 12
0
votes
1 answer

Trouble with SQL query from VBA when trying to select fields of 'Widestring' type (Access .mbd file)

I am trying to import some data from a .mbd-file into Excel. I can copy the whole database into a spreadsheet, no problem there. I can also use a statement like this sSQL = "SELECT HOEHE " & "FROM h_datei WHERE HOEHE >= 53 " The problem arises when…
0
votes
0 answers

Adding "L" to a string literal works to make it wide string, but not to a variable

The macro #define STR16(x) L ## x works when applied to string literals: STR16("Hello") // fine, this is translated to L"Hello" but not to variables: STR16(x) // fails, this is translated to Lx, and the variable Lx doesn't exist In line…
Basj
  • 41,386
  • 99
  • 383
  • 673
0
votes
2 answers

Local WideString variable debug error "Int3 DbgBreakPoint"

In C++Builder, I wrote the following code (in Button1Click handler), When I run in debug mode, I get the "Int3 DbgBreakPoint" (Stack corrupted?). This doesn't happen for AnsiSting (Maybe reference counting). WideString boshluq; boshluq=L" "; Is…
samir105
  • 949
  • 11
  • 16
0
votes
3 answers

Convert char to wchar_t using standard library?

I have a function that expects a wchar_t array as a parameter.I don't know of a standard library function to make a conversion from char to wchar_t so I wrote a quick dirty function, but I want a reliable solution free from bugs and undefined…
user6274708
0
votes
4 answers

C++ template function specialization using TCHAR on Visual Studio 2005

I'm writing a logging class that uses a templatized operator<< function. I'm specializing the template function on wide-character string so that I can do some wide-to-narrow translation before writing the log message. I can't get TCHAR to work…