mediawiki-extensions-Scribunto/engines/LuaCommon/lualib/ustring
Brad Jorsch cd618c7a92 ustring: Handle "empty" charset like Lua does (part 2)
Lua actually treats a close-bracket at the start of a bracketed
character class as a literal, rather than using it to close the
character class. Probably unintended behavior, but it happens.

Also, have the pure-lua version throw our more informative errors on
error even when falling back to string.find and the like, and fix some
other weird edge cases that came up in testing.

Bug: T95958
Bug: T115686
Change-Id: Iab783d4a3e58b1514cc09729d4a71c2cb1242ee8
2015-10-16 09:26:55 -04:00
..
charsets.lua Add frontier pattern (%f[set]) to ustring 2013-05-12 10:27:36 -04:00
lower.lua Lua ustring implementation 2013-02-12 14:26:29 -05:00
make-normalization-table.php Use full <?php instead of short <? in ustring generation scripts 2015-03-17 18:16:20 -07:00
make-tables.php Use full <?php instead of short <? in ustring generation scripts 2015-03-17 18:16:20 -07:00
normalization-data.lua Lua ustring implementation 2013-02-12 14:26:29 -05:00
README Update make-normalization-table for core file moves 2015-02-04 20:04:41 +00:00
string.lua Lua ustring implementation 2013-02-12 14:26:29 -05:00
upper.lua Lua ustring implementation 2013-02-12 14:26:29 -05:00
ustring.lua ustring: Handle "empty" charset like Lua does (part 2) 2015-10-16 09:26:55 -04:00

This is ustring, a pure-Lua library to handle UTF-8 strings.

It implements generally the same interface as the standard string library, with
the following differences:
* Most functions work on codepoints rather than bytes or characters. Yes, this
  means that even though "á" and "á" should appear identical and represent the
  same character, the former is one codepoint (U+00E1) while the latter is two
  (U+0061 U+0301).
* Added functions isutf8, byteoffset, codepoint, gcodepoint, toNFC, toNFD.
* No workalike for string.reverse is provided.

Contents:
* README - This file.
* ustring.lua - The main file for the library.
* string.lua - Extend the string metatable with methods from this library.
* upper.lua - Data table for ustring.upper.
* lower.lua - Data table for ustring.lower.
* charsets.lua - Data tables for pattern matching functions.
* make-tables.php - Regenerate upper.lua and lower.lua using PHP's multibyte
  string library, and charsets.lua using PCRE.
* normalization-data.lua - Data tables for toNFC and toNFD.
* make-normalization-table.php - Regenerate normalization-data.lua based on the
  file includes/libs/normal/UtfNormalData.inc from MediaWiki core.


This library (consisting of the files described above) is released under the MIT
License:

Copyright (C) 2012 Brad Jorsch <bjorsch@wikimedia.org>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.