# C++ UENUM in BluePrint "Enum to String" Returns different values in Android/Windows

**URL:** <https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430>\
**Category:** Blueprint\
**Tags:** ENUM, unreal-engine, Android, CPP, Blueprint, question\
**Created:** [August 31, 2017, 11:45pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430 "2017-08-31T23:45:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [August 31, 2017, 11:45pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/1 "2017-08-31T23:45:29Z")

</div>

If you have a C++ UENum with a DisplayName set

```
UENUM(BlueprintType) //"BlueprintType" is essential to include
enum class EVictoryEnum : uint8
{
        VE_Dance UMETA(DisplayName="Dance"),
        VE_Rain UMETA(DisplayName="Rain"),
	    VE_Song	UMETA(DisplayName="Song")
};

```

Running in PIE the String conversion works as expected (Dance, Rain, Song). However If you run on Android or Windows you get the code name instead of the display Name, (VE\_Dance, VE\_Rain, VE\_Song)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [September 1, 2017, 3:31pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/2 "2017-09-01T15:31:08Z")

</div>

Hey -

The reason for this difference is because the meta data is stripped out of shipping builds, so the behavior you’re seeing here is expected. The DisplayName is mainly meant to help organize / reference the parts of the enum in the editor.

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [September 1, 2017, 3:43pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/3 "2017-09-01T15:43:20Z")

</div>

So If I wanted to display string representation of an enumeration on the screen I need to write my own Enum To String Map and conversions myself? instead of relying on the automatic blueprint conversions “Enum To String”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [September 1, 2017, 3:45pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/4 "2017-09-01T15:45:23Z")

</div>

For any one looking to do this, DO NOT follow this example as it also uses Code based string representations of the enumerations vs user friendly representation like display\_name

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [September 1, 2017, 4:20pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/5 "2017-09-01T16:20:35Z")

</div>

If you want to print what is set as the UMETA(DisplayName) then you would need to create your own way to do so, yes. Alternatively, you can rename the enum values in code to whatever name you would like displayed using the EnumToString node.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [September 1, 2017, 4:45pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/6 "2017-09-01T16:45:48Z")

</div>

Thanks for the very fast response, of course enum names are restricted from having characters like spaces or conflicting with keywords so this mean writing my own conversions.

It would be nice if the “Enum To String” conversion had a tooltip or something explaining its behavior is different in debug mode vs deployment. While I understand the reasoning for it, its very confusing behavior for a developer. Especially since its an auto-conversion.

The Description for “Enum to String” is “Returns user friendly string for enumerator” I think that description is not accurate and should be updated as the string returned for the enumerator is not user friendly always.

---

<div class="post-metadata">

**Author:** ![spartanstas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spartanstas](https://forums.unrealengine.com/u/spartanstas)\
**Post date:** [August 5, 2024, 3:10pm UTC](https://forums.unrealengine.com/t/c-uenum-in-blueprint-enum-to-string-returns-different-values-in-android-windows/403430/7 "2024-08-05T15:10:08Z")

</div>

I found solution for myself, that might works for you all as well.  
I’ve added underscore ‘\_’ in each of my enum value where spacebar ’ ’ is required.  
Then in my blueprint I use Unreal Engine’s “Enum to String” function and after that I use function “Replace” of FString class.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/5/945361805fbcfc3aaeb0c5e04d3bf21635f9bce1.png)
