GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

Problem with dIsSpace with UTF8 text #657

Open jamesu opened 10 years ago

jamesu commented 10 years ago

If you attempt to use dIsspace on UTF8 text which uses high ranged unicode characters (e.g. japanese text), you may get an assert in a DEBUG build on windows due to the character value being out of range for ASCII. This prevents such text from being passed to several functions making it slightly impractical to use international text in Torque3D, at least in windows.

I should also note that technically calling dIsspace on a UTF8 character is not quite correct as there are several space characters in unicode which don't fit into a single UTF8 character.

Affected functions:

crabmusket commented 10 years ago

So this requires replacing the use of dIsSpace with an equivalent that will work for UTF8 strings?

jamesu commented 10 years ago

Possible solutions:

Nothing else is really makes much sense as dIsSpace only accepts char. Likely the intent of the code is only to accept basic spaces anyway.