# TCP Driver Non Ascii Characters Received are converted to unicode 0xfffd

**URL:** <https://forum.inductiveautomation.com/t/tcp-driver-non-ascii-characters-received-are-converted-to-unicode-0xfffd/19596>\
**Category:** Ignition\
**Created:** [September 9, 2018, 10:43am UTC](https://forum.inductiveautomation.com/t/tcp-driver-non-ascii-characters-received-are-converted-to-unicode-0xfffd/19596 "2018-09-09T10:43:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malcolm](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/malcolm/32/5970_2.png) [@Malcolm](https://forum.inductiveautomation.com/u/Malcolm)\
**Post date:** [September 9, 2018, 10:43am UTC](https://forum.inductiveautomation.com/t/tcp-driver-non-ascii-characters-received-are-converted-to-unicode-0xfffd/19596/1 "2018-09-09T10:43:43Z")

</div>

Hi,

I have successfully connected via the TCP Driver to Keyence Device which will return data via TCP when I send a command, I have an issue that the reply is being received, but , as the reply has any value between 0-255 in each byte i believe due to the tag type being a string it is being encoded to unicode, which is failing to convert some of the bytes an returns a 0xfffd value, this enlarges the returned data and means i cannot extract the correct values.

From research I really think I need to receive the data into a byte array which will mean using the SOCKETS library to open the port to be able to receive the raw data correctly. Unless there is anyway to get the TCP driver to provide this.

Any advice appreciated.

---

<div class="post-metadata">

**Author:** ![Malcolm](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/malcolm/32/5970_2.png) [@Malcolm](https://forum.inductiveautomation.com/u/Malcolm)\
**Post date:** [September 9, 2018, 1:34pm UTC](https://forum.inductiveautomation.com/t/tcp-driver-non-ascii-characters-received-are-converted-to-unicode-0xfffd/19596/2 "2018-09-09T13:34:22Z")

</div>

I have continued to search forums and found another thread related to this and confirms I need to use Scripted TCP Connection, the thread i found is below

> [@UDP driver altering data](http://forum.inductiveautomation.com/t/udp-driver-altering-data/10322):
>
> I’ve encountered a problem with the UDP driver. I’m trying to bring in a sequence of bytes which contain binary representations of different values (e.g. 32-bit integers and 32-bit IEEE floating point numbers). I’ve set the Message Delimiter Type to PacketBased, which brings the whole sequence in as a string. The problem with this is that it cannot cope with byte values greater than 127. If it finds any it replaces them with 0xfd. Any ideas how we can access the correct values? We were hoping …
