utf-support (LUA related/ server): 1) new: dan200.computercraft.shared.utf.UtfString and dan200.computercraft.shared.utf.UtfException new class for fast character management, length detection, replacements etc. 2) new: dan200.computercraft.core.apis.Utf8API Using OneArgFunction etc. because we need direct access to the byte arrays inside LuaString Using the CCraft API will give us java strings that may replace the utf sequences by '?'. 2.1) Function "dump" from string api (maybe changed in future to support utf) 2.2) Function "len" to return utf8 character length; see https://www.lua.org/manual/5.3/manual.html#6.5 2.3) Function "lower" to lower case all utf characters; depending on java locale 2.4) Function "reverse" to reverse utf characters without breaking them 2.5) function "upper" to upper case all utf characters; depending on java locale 2.6) Function "char" to create utf chars by utf codepoint (integers); see https://www.lua.org/manual/5.3/manual.html#6.5 2.7) Function "find" a utf variant of string.find 2.8) Function "format" a utf variant of string.format 2.9) Function "gmatch" a utf variant of string.gmatch 2.10) Function "gsub" a utf variant of string.gsub 2.11) Function "match" a utf variant of string.match 2.12) Function "rep" from string api (maybe changed in future to support utf) 2.13) Function "charpattern" see https://www.lua.org/manual/5.3/manual.html#6.5 2.14) Function "sub" a utf variant or string.sub, given numbers are the character positions 2.15) Function "codes" iterator for utf codepoints; see https://www.lua.org/manual/5.3/manual.html#6.5 2.16) Function "offset" binary position of characters; see https://www.lua.org/manual/5.3/manual.html#6.5 2.17) Function "convertAscii" converts an old CCraft ascii string for use in utf output functions, see window.lua; characters above 0x7F will be converted in multi byte utf8 characters 3) Changed: dan200.computercraft.core.lua.LuaJLuaMachine Loading Utf8API 4) Changed: dan200.computercraft.core.apis.handles.EncodedInputHandle Added flag doNotWrapUtf8 for real utf support 4.1) Method read correctly handles surrogates and takes real character length as argument 4.2) Methods readLine and readAll will no longer replace utf8 multi byte sequences with '?' 5) Changed: dan200.computercraft.core.apis.handles.EncodedOutputHandle Added flag doNotWrapUtf8 for real utf support 5.1) Method write and writeLine uses the binary content or LuaString thus leaving utf8 characters unchanged. 6) Changes: dan200.computercraft.core.apis.FSAPI Supporting new modes: "ru", "wu", "au". Similar to original text modes, but does not replace multibyte utf-8 characters with '?' 6.1) Mode "ru": see changes in #3; old modes will behave the same 6.2) Modes "wu"/"au": see changes in #4; old modes will behave the same 7) Changes: dan200.computercraft.core.apis.http.HTTPRequest Added flag doNotWrapUtf8 for real utf support 8) Changes: dan200.computercraft.core.apis.HTTPAPI NOTICE: Already contains undocumented fourth argument, boolean: arg4 = FALSE means: binary arg4 = TRUE means: text mode (old style); default 8.1) new variants of arg4 arg4 = 0 means: binary arg4 = 1 means: old tyle text arg4 = 2 means: utf8 text without wrapping characters 9) Changes: dan200.computercraft.core.apis.TermAPI 8.1) Function "writeutf8" correctly handles utf8 8.2) Function "blitutf8" correctly handles utf8 10) Changes: dan200.computercraft.core.apis.ArgumentHelper 10.1) new method "getUtfString" 10.2) new method "optUtfString" 11) Changes: dan200.computercraft.core.terminal.Terminal 11.1) new utf variants of methods: blit, write, setLine 12) Changes: dan200.computercraft.core.terminal.TextBuffer 12.1) now holds internally utf strings 12.2) new utf variants of constructor and methods read, write, fill, charAt, setChar 13) Changes: dan200.computercraft.core.apis.BufferAPI although not used in CCraft itself. 13.1) new method "newuft8" that does not break utf characters 14) Changes: dan200.computercraft.shared.peripheral.monitor.MonitorPeripheral 14.1) Function "writeutf8" correctly handles utf8 14.2) Function "blitutf8" correctly handles utf8 font-support (mostly client-related) 1) Changes: dan200.computercraft.client.gui.FixedWidthFontRenderer Font selector support 2) new class: dan200.computercraft.client.gui.FontManager 3) new class: dan200.computercraft.client.gui.FontDefinition 4) Changes: dan200.computercraft.ComputerCraft 4.1) made some methods public 4.2) new method getFont for clients 5) Changed: dan200.computercraft.client.gui.widgets.WidgetTerminal allow font selection 6) Changed: dan200.computercraft.client.render.TileEntityMonitorRenderer allow font selection 7) Changed: dan200.computercraft.shared.proxy.IComputerCraftProxy, dan200.computercraft.client.proxy.ComputerCraftProxyClient, dan200.computercraft.server.proxy.ComputerCraftProxyServer 7.1) postInit method 7.2) getFont method (for client) 8) Changed: dan200.computercraft.core.terminal.Terminal 8.1) methods getFontName, setFontName and sending font names over network 9) Changed: dan200.computercraft.core.apis.TermAPI 9.1) new functions "getFontName", "setFontName" 10) Changed: dan200.computercraft.shared.peripheral.monitor.MonitorPeripheral 10.1) new functions "getFontName", "setFontName" Events: 1) Changes: dan200.computercraft.client.gui.widgets.WidgetTerminal 1.1) changed char event to distribute utf strings 1.2) changed paste event to distribute utf strings bios/CraftOS 1) Changes: bios.lua 1.1) new global function writeutf8 1.2) new global function printutf8 1.3) new global function printErrorUtf8 1.4) new global function readutf8 1.5) new global function loadutf8 1.6) new global function loadfileutf8 1.7) new global function dofileutf8 1.8) new function os.runutf8 1.9) new function os.loadAPIUtf8 1.10) new api folder for automatically loaded apis: /rom/apisutf8 2) Changes: window.lua now internally works on utf strings 2.1) new function window.writeutf8 2.2) new function window.blitutf8 3) Changes: textutils.lua 3.1) new function "slowWriteUtf8" 3.2) new function "slowPrintUtf8" 3.3) new function "pagedPrintUtf8" 3.4) new function "tabulateUtf8" 3.5) new function "pagedTabulateUtf8" TODOs: - there seems to be an old copy of HTTPRequest at dan200.computercraft.core.apis.HTTPRequest; not used inside CCraft and maybe we should delete this. But this may break other plugins depending on it. - check if we need utf methods at dan200.computercraft.shared.peripheral.commandblock.CommandBlockPeripheral; it may not receive and handle the correct utf strings - check if we need utf methods at dan200.computercraft.shared.computer.blocks.ComputerPeripheral (label name) - check if we need utf methods at dan200.computercraft.shared.peripheral.diskdrive.DiskDrivePeripheral (label name etc.), review disk.lua too - check if we need utf methods at dan200.computercraft.shared.peripheral.modem.TileCable.Peripheral (names etc.) - utf variant for dan200.computercraft.shared.peripheral.modem.ModemPeripheral:transmit - utf variant for dan200.computercraft.shared.peripheral.modem.TileCable.Peripheral:callRemote - utf variant for dan200.computercraft.shared.peripheral.printer.PrinterPeripheral:write - GuiPrintout: Use UtfString, allow font selection... - TODO check dan200.computercraft.shared.peripheral.printer.TilePrinter.outputPage() for utf support -- TODO some support for rom/apisutf8/command/commands.lua, see bios.lua -- TODO some refactoring on bios.lua; contains many duplicode code fragments because of utf8 -- TODO review programs, some of them need rework for full utf8 support -- edit.lua -- shell.lua -- lua.lua -- multishell.lua -- pastebin.lua -- wget.lua -- chat.lua -- exec.lua