TChar::ToUnsigned

Avoid sign extension problems with signed characters smaller than int

Windows
MacOS
Linux

Syntax

static uint32 ToUnsigned
(
    CharType Char
)

Remarks

Avoid sign extension problems with signed characters smaller than int

E.g. 'Ö' - 'A' is negative since the char 'Ö' (0xD6) is negative and gets sign-extended to the 32-bit int 0xFFFFFFD6 before subtraction happens.

Mainly needed for subtraction and addition.

References

Module

Core

Header

Runtime/Core/Public/Misc/Char.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback