View Issue Details

IDProjectCategoryView StatusLast Update
0008606Multi Theft Auto : San AndreasScriptingpublic2015-01-10 00:00
ReporterccwAssigned Tosbx320 
PrioritylowSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Product Version1.4 
Target Version1.4.1Fixed in Version1.4.1 
Summary0008606: Add support for unicode gsub, gmatch, find, match and reverse
Description

MTA is missing unicode equivalents for string functions such as gsub, gmatch, find, match and reverse

Additional Information

Some geezer has made a utf8 module for Lua: https://github.com/starwing/luautf8
It provides the following functions:
utf8.byte
utf8.char
utf8.find
utf8.gmatch
utf8.gsub
utf8.len
utf8.lower
utf8.match
utf8.reverse
utf8.sub
utf8.upper

Should we add this and deprecate the current MTA utf* functions?

TagsNo tags attached.

Relationships

related to 0008600 resolvedsbx320 Using gsub on certain chars causes a graphical glich 

Activities

qaisjp

2014-11-02 17:24

administrator   ~~0022254

Even better, just "include" the utf8 library into the string library.
And then deprecate the utf*

Necktrox

2014-11-02 21:24

developer   ~~0022256

You could also use the new preg (regex) functions.

Talidan

2014-11-07 00:46

administrator   ~~0022265

Last edited: 2014-11-07 00:48

View 2 revisions

I don't remember if it were this library, but some of the utf* functions are based upon the source code of some other one. The function "utf.byte" seems like a very strange function name. I opted for "utf.code".

Other than that strange function name, I'm all for this replacement, providing it works fine with our quirky unicode support.

Regarding replacing the string library - providing it replaces every relevant function, that seems like a plausible idea too. Might cause some unforeseen issues though.

lopezloo

2015-01-09 23:56

developer   ~~0022815

Fixed in r7001
https://code.google.com/p/mtasa-blue/source/detail?r=7001

sbx320

2015-01-10 00:00

administrator   ~~0022817

Fixed in https://code.google.com/p/mtasa-blue/source/detail?r=7001

Issue History

Date Modified Username Field Change