Commit Graph

52 Commits

Author SHA1 Message Date
ab854ec035 Improve UTF-8 support in some natives (bug 6475) (#407)
* Compile as static library, update AMBuildScript and link to core

* Update VS project files to include the library

* Add UTF-8 Rewind library (v1.5.1) to third_party directory

* Update ACKNOWLEDGEMENTS.txt

* Move AMXX buffer in its own function

* Move constants from string.inc to string_const.inc and update project files

* Move stocks from string.inc to string_stocks.inc and update project files

* Improve UTF-8 support in containi() and update documentation

* Improve UTF-8 support in strcmp() and update documentation

* Improve UTF-8 support in strfind() and update documentation

Worth to be noted that this native with ignorecase set was not working properly. So broken that no one reported the issue.
This adds also a safety check for "pos" parameter to not go < 0.

* Improve UTF-8 support in strncmp() and update documentation

* Improve UTF-8 support in equali() and update documentation

* Add an option to some UTF-8 Rewind functions for avoiding invalid data to be replaced

By default it replaces any invalid byte or sequence of bytes by 0xFFFD (3 bytes). It can be problematic when the input buffer is not changed (from a plugin) and that some natives need to calculate a position from the converted string. With such replacement, the position is displaced due the final string length being larger.

This compiles the library as C++, because I added some silly param with a default default value which is not supported by C.

* Improve UTF-8 support in replace_string/ex() and update documentation

* Add is_string_category() and update documentation

* Update a little testsuite plugin (and fix linux compilation)

* Add mb_strotolower/upper() and update documentation

* Add mb_ucfirst() and update documentation

* Add mb_strtotile() and update documentation

* Improve UTF-8 support in get_players() and find_player() with name/case insenstive flags set

* Fix KliPPy's complain
2017-08-05 10:32:16 +02:00
be06e2448b Add fmt() native to format and return inline a string 2016-02-23 19:56:02 +01:00
520493fab1 Compiler: Add #pragma deprecated.
This is based on SM, including patch to support macros/constants (https://hg.alliedmods.net/sourcemod-central/rev/ef8dd1cddc35).
Updated also some pawn includes to use this new pragma.
2014-08-26 09:04:36 +02:00
f787db1be5 Update license headers for plugins and includes. 2014-08-04 13:18:41 -05:00
c068c0d0f4 Fix some comments 2014-08-02 19:12:32 +03:00
a86ca1491f Add new string natives/stocks, make some UTF-8 safe (bug 6110, r=ds) 2014-04-30 09:33:03 +02:00
5dc96ddf47 Add strtof native (bug 5909, r=Nextra) 2014-03-20 18:21:38 +01:00
e2855dee7d Undo vim modelines. 2014-02-09 23:49:19 -08:00
aa46469878 Add new variants of strbreak, which is too broken to use. 2014-02-09 23:40:45 -08:00
eb43b69e4d Add strtok2 which fixes a trim issue with strtok (bug 3993, r=arkshine)
Former-commit-id: ad9e3ad972b6f7a2e34c61d615e25de07c9acdfa
2013-07-31 23:40:49 +02:00
6912199ae0 Comply to AMXX style for more consistency in 8f3605ea03d5
Former-commit-id: 3075e0b375fcede21f2055442305d1ffdb9b64fd
2013-07-02 23:13:26 +02:00
873fb6924f Add strtol native (bug 3233, r=joropito)
Former-commit-id: 9508f9f86db99e93de1819f585c741396d8e4c30
2013-06-27 18:55:19 +02:00
a26a98cb98 Fix incorrect result for replace_all (bug 5064, r=dvander).
Former-commit-id: e3824c4c87c43734e6c5d4831f2ca7cece0a5147
2013-02-13 00:40:57 -08:00
66feed1d2b Added charsmax() define, as a less typo-prone utility for sizeof(array)-1.
Added any: syntax to all variable args that need it, added proper {Float,_}: tags to some that didn't have it but should have.
2007-05-18 15:20:34 +00:00
d563ecb060 Added pseudo dynamic array natives.
Changed some of the "..." tags to "any".
2007-04-24 16:38:36 +00:00
bd412d7204 Fixed bug amb70 - include files not semicolon-correct
Also, removed OLOcode from amxmisc.inc
2007-03-05 19:30:40 +00:00
dd8f138892 Back ported revision 3242 - Every include file now is const correct (am49281) 2007-01-26 05:56:10 +00:00
d925dc6e41 bugfix: correct string length computation in replace_all 2006-09-12 13:26:40 +00:00
d95f794844 rewrote replace_all()
added replace_all() tests
2006-09-10 08:15:00 +00:00
3754604686 Fixed a serious bug in replace_all() that could make replaces fail or corrupt random data 2006-09-10 07:23:08 +00:00
1b9ef4d268 2006-09-10 05:16:26 +00:00
388711e969 Synced bcompat tree additions and fixes found so far 2006-08-28 11:08:18 +00:00
7a533c7be5 Added vformat() 2006-05-07 00:25:30 +00:00
982b22ab20 fixed bug in split() 2006-03-06 14:54:12 +00:00
1f2d9c8a92 typos, made language harsher 2006-02-24 10:12:55 +00:00
1d30d0831b i have a hat 2006-02-24 07:49:08 +00:00
4b51565e3b hello my name is pm and i just fixed the bug described in 23888 2006-01-04 23:23:52 +00:00
8196ddd0b3 added replace_all stock (by jtp10181) 2005-11-21 21:47:54 +00:00
bb292d13ad added remove_filepath stock 2005-11-20 23:45:53 +00:00
94308b208a fixed bug at19374 2005-11-17 21:12:50 +00:00
1e5c9b5ed7 added a new stock by Suicid3 (at20399) 2005-11-12 22:43:55 +00:00
4b1769f457 Added feature request at18988 2005-09-15 17:53:02 +00:00
bece1e6d0c Added float_to_str and str_to_float natives 2005-09-06 16:34:17 +00:00
5d92972aad one more 2005-07-30 16:46:40 +00:00
389a593f9e ugh 2005-07-30 16:41:34 +00:00
e23726ac54 added amx_strtok for jtp10181 2004-09-19 17:25:51 +00:00
1aee2c6f81 Fixed format tags 2004-09-07 09:26:20 +00:00
2ca6e3382e added ucfirst() 2004-08-01 16:49:24 +00:00
3a904ed05c added trim() 2004-07-24 01:52:45 +00:00
8ef66cee8c added natives 2004-04-03 20:05:27 +00:00
1fa97936ff strbreak() added 2004-04-03 03:00:57 +00:00
b938e955f5 removed stocks: int_to_str, str_to_int, numtostr and strtonum 2004-03-08 17:28:57 +00:00
08b3491f52 Removed bad str/num funcs 2004-03-08 06:07:47 +00:00
297e1a4d29 Removed bad str/num funcs 2004-03-08 05:29:51 +00:00
c6dd8eac6b Removed bad str/num funcs 2004-03-08 05:28:18 +00:00
75ac8fd494 moved backwards compatibility to amxmod.inc 2004-03-07 11:23:57 +00:00
79e0d80d4d nothing important 2004-03-05 19:30:29 +00:00
4984e4b5a2 removed strtonum and numtostr 2004-03-05 18:55:13 +00:00
87b4d3570f updated header | readded double include prevention 2004-02-21 20:30:04 +00:00
21d870c57a no message 2004-02-15 02:29:51 +00:00