# Field AsAnsiString

**URL:** https://talk.remobjects.com/t/field-asansistring/16181
**Category:** Data Abstract
**Tags:** delphi
**Created:** [April 17, 2018, 12:29pm UTC](https://talk.remobjects.com/t/field-asansistring/16181 "2018-04-17T12:29:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Filip\_Lagrou](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/f/d6d6ee/32.png) [@Filip\_Lagrou](https://talk.remobjects.com/u/Filip_Lagrou)
#### Post date: [April 17, 2018, 12:29pm UTC](https://talk.remobjects.com/t/field-asansistring/16181/1 "2018-04-17T12:29:15Z")

</div>

Hi,

Using Delphi Tokyo 10.2.2 - DA 9.3.105

Trying to get a field of an IDADataset as AnsiString returns a string instead of an AnsiString

in unit uDACore - line 311  
property AsAnsiString: **string** read GetAsAnsiString write SetAsAnsiString; //null-\>’’

Regards,

Filip.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [April 17, 2018, 12:50pm UTC](https://talk.remobjects.com/t/field-asansistring/16181/2 "2018-04-17T12:50:05Z")

</div>

as expected. we have deprecated AnsiString in favor of mobile platforms and Linux where is this type not present.

I can recommend to use `AsBytes` that can be easily transformed to `AnsiString` via `PAnsiChar`.

---

<div class="post-metadata">

### Author: ![Filip\_Lagrou](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/f/d6d6ee/32.png) [@Filip\_Lagrou](https://talk.remobjects.com/u/Filip_Lagrou)
#### Post date: [April 17, 2018, 1:07pm UTC](https://talk.remobjects.com/t/field-asansistring/16181/3 "2018-04-17T13:07:24Z")

</div>

Hi Evgeny,

I understand why this is deprecated, but nevertheless we have ansistrings in our DB which have to be handled as ansistring.

I would have expected some “platform directives” in the code to handle these different situations because Windows still supports ansistrings.

That’s why I mentioned this…

Regards,

Filip Lagrou

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [April 17, 2018, 1:13pm UTC](https://talk.remobjects.com/t/field-asansistring/16181/4 "2018-04-17T13:13:34Z")

</div>

we have some methods in `uROEncoding.pas` for conversion from Ansi/UTF8 to Unicode and vice versa.
