# C++ BYTE ARRAY TO STRING?

**URL:** <https://forums.unrealengine.com/t/c-byte-array-to-string/474340>\
**Category:** UI\
**Tags:** string, text, unreal-engine, file, CPP, question\
**Created:** [November 12, 2020, 1:34pm UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340 "2020-11-12T13:34:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zSSkitzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zSSkitzz](https://forums.unrealengine.com/u/zSSkitzz)\
**Post date:** [November 12, 2020, 1:34pm UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340/1 "2020-11-12T13:34:40Z")

</div>

Hello! Basically, when I use FObjectAndNameAsStringProxyArchive to serialize pointers, it uses paths instead, and when I use FFileHelper::SaveArrayToFile(), in the text file it shows the path in the text file. I want to be able to somehow, convert the array of bytes into an array of strings or as one string and the value to be just like in the text file. For example: Let’s say one of the paths is /Game/RandomActor.Actor\_C, when I save the data into a text file the path will be in the text file as text. I want to somehow, convert the data into string(s) and for it to contain the path just like in the text file. Also, using the ByteToString() function, the data gets corrupted when being converted into a string. I hope this makes sense! If you have any questions or any solutions please comment below. Thanks!

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [November 12, 2020, 1:35pm UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340/2 "2020-11-12T13:35:30Z")

</div>

Did you read this? [Character Encoding in Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/StringHandling/CharacterEncoding/index.html)

---

<div class="post-metadata">

**Author:** ![zSSkitzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zSSkitzz](https://forums.unrealengine.com/u/zSSkitzz)\
**Post date:** [November 13, 2020, 3:44am UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340/3 "2020-11-13T03:44:15Z")

</div>

Actually, I solved this earlier today. Thanks Anyway!

---

<div class="post-metadata">

**Author:** ![Falen13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Falen13](https://forums.unrealengine.com/u/Falen13)\
**Post date:** [November 13, 2020, 7:09am UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340/4 "2020-11-13T07:09:31Z")

</div>

How did you do it?

---

<div class="post-metadata">

**Author:** ![zSSkitzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zSSkitzz](https://forums.unrealengine.com/u/zSSkitzz)\
**Post date:** [November 13, 2020, 7:50am UTC](https://forums.unrealengine.com/t/c-byte-array-to-string/474340/5 "2020-11-13T07:50:16Z")

</div>

Oh actually, when I meant I solved it I meant I didn’t really need it. When I tried using it, it corrupted the data from both from and to the byte array.
