Questions tagged [ansistring]

An ANSI string is an array of 8 bit characters from the ANSI character set, a superset of the 7 bit ASCII character set, terminated by a binary zero. The ANSI string is primarily used in the C programming language and manipulated by a set of ANSI string functions provided by the C Standard Library. Most questions involving ansistring pertain to transformations to other character sets or other representations such as to UNICODE or std::string in C++.

54 questions
2
votes
1 answer

bds 2006 C hidden memory manager conflicts (class new / delete[] vs. AnsiString)

I am using BDS 2006 Turbo C++ for a long time now and some of my bigger projects (CAD/CAM,3D gfx engines and Astronomic computations) occasionally throw an exception (for example once in 3-12 months of 24/7 heavy duty usage). After extensive…
Spektre
  • 49,595
  • 11
  • 110
  • 380
2
votes
2 answers

Delphi (2009) - Converting AnsiString reading or preserving line breaks?

Using this (test) code to read a tEXt chunk from a PNG: procedure TForm1.Button1Click(Sender: TObject); var PngVar: TPngImage; n: Integer; begin PngVar := TPNGImage.Create; PngVar.LoadFromFile('C:\test.png'); for n := 0 to…
Brian Holloway
  • 205
  • 4
  • 15
2
votes
1 answer

NHibenate. How to set IType in Projections.Constant?

I have a project using NHibernate 2.1.2.4000 with .Net OracleClient, to connect to an old Oracle 8i production database. I have implemented an ICriteria, that is generating the correct query, but the following internal exception is raised:…
GCuevasR
  • 21
  • 5
1
vote
1 answer

Definitions of: AnsiString, WideString, String, char[], char*, BSTR,

This is a followup to this question AnsiString is a class, too? And string? It is a class? And a char[]? Can we say a WideString is a wrapper over double-byte characters, AnsiString is a wrapper over single-byte characters, and char[] is an array…
Eduard
  • 664
  • 2
  • 14
  • 26
1
vote
2 answers

Delphi Ansistrings

I have a case here, I am going to migrate over to delphi 2011 XE from Delphi 7, and to my surprise many components will have problems due to ansistrings, in delphi xe they look like japanese / chinese characters, now the unit I use is a PCSC…
Plastkort
  • 957
  • 1
  • 26
  • 40
1
vote
3 answers

AnsiString to Double C++

I am trying to convert an AnsiString to a double, but after running the programm, it says "20.60 is not a valid floating point". AnsiString Temperatur RE_Temperatur->Text = Temperatur; Chart1->Series[0]->AddXY(DT_Uhrzeit->Time,…
kevin
  • 71
  • 1
  • 8
1
vote
3 answers

C++ UnixTimestamp and readable time format

I get a timestamp as an AnsiString from my database in my C++ application. It looks like this "2017-09-12 09:35:10". Now I want to parse it back into an Unix Timestamp. AnsiString myDate = Query->Fields->FieldByName("MyDates")->AsString; TDateTime =…
Shijury
  • 39
  • 3
1
vote
2 answers

Including DShow.h breaks VCL AnsiString::sprintf() on BDS2006

I finally got some time to upgrade my video capture class. I wanted to compare VFW (what I have used until now) and DirectShow. As expected, DirectShow is faster, but when I added info texts, suddenly AnsiString::sprint() is no longer a member of…
Spektre
  • 49,595
  • 11
  • 110
  • 380
1
vote
1 answer

Convert AnsiString to UnicodeString in Lazarus with FreePascal

I found similar topics here but none of them had the solution to my question, so I am asking it in a new thread. Couple of days ago, I changed the format the preferences of an application I am developing is saved, from INI to JSON. I use the…
Anusha Dharmasena
  • 1,219
  • 14
  • 25
1
vote
1 answer

How to use AnsiString to store binary data?

I have a simple question. I want to use AnsiString as a container for binary data. I mostly load such data from TMemoryStream or TFileStream and I save it back from AnsiString after some processing. Works fine, haven't found a problem with…
Coder12345
  • 3,431
  • 3
  • 33
  • 73
1
vote
1 answer

Delphi AnsiString Manipulation - PAnsiChar becomes corrupt?

I use the following approach to move through and manipulate an AnsiString. It works most of the time, but sometimes the pointer into the string quits functioning. Given the following code: var s: AnsiString; p: PAnsiChar; offset, idx, cnt:…
James L.
  • 9,384
  • 5
  • 38
  • 77
1
vote
2 answers

Setting type as AnsiString for NHibernate Queries using Oracle

After some digging I found that the reason the following NHibernate query IList users = session.QueryOver() .WhereRestrictionOn(user => user.EmployeeID) .IsInG(new string[]…
1
vote
2 answers

Porting a Delphi 2006 app to XE

I am wanting to port several large apps from Delphi 2006 to XE. The reasons are not so much to do with Unicode, but to take advantage of (hopefully) better IDE stability, native PNG support, more components, less VCL bugs, less dependence on 3rd…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
0
votes
0 answers

ANSIContainsText strange behaivour

When using ANSIContainsText in this way: ... const searchText : ANSIString = 'Text'; targetText : string = 'TargetText'; ... Result := ANSIContainsText (targetText, searchText); ... Returns False. Instead, if I use in…
user2383818
  • 709
  • 1
  • 8
  • 19
0
votes
1 answer

Adapt Pascal function AnsiChar() and AnsiString() in JavaScript?

i need to adapt a pascal script into JavaScript. I was able to translate nearly all the code except this two functions. Pascal codelines: Result:= AnsiChar(b + ord('0')); s:= AnsiString(copy(ReNr, 1, length(ReNr) - 1));` The code in the…
Tactic
  • 83
  • 1
  • 1
  • 5