Thread: in progress
View Single Post
05-05-14, 10:56 PM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by ObbleYeah View Post
does anyone know why my string for truncating names breaks when special characters are involved?
Yes. The Lua string functions are not UTF8-aware. To simplify your life, I'd suggest just using the UTF8 library, and then you can just do:

Code:
text:utf8sub(1,4)
to truncate to the first 4 characters.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote