Fix fallout from SimpleGraphic upgrade with wider Unicode support #7586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the problem being solved:
In PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic#59 there were significant foundational improvements for users installing Path of Building into paths with characters that cannot be expressed in their codepage.
There is also a companion PR for the Launcher in PathOfBuildingCommunity/PathOfBuilding-Launcher#6.
In short:
GetScriptPath
/GetUserPath
yields paths in UTF-8,[U+1234]
"tofu" in a smaller font size,lua-utf8
is exposed to the Lua side.This means that Lua code that touches things like the full build path or the script path may need to adapt to process UTF-8 correctly with string operations.
In order to help with that, the SimpleGraphic update also features luautf8, a Lua extension that provides UTF-8 analogues of many string operations like
gsub
,match
, etc.This change leverages that extension via
local utf8 = require('lua-utf8')
to correctly move the text caret with the cursor keys in edit controls, and also showcases its use to handle (hypothetical) Unicode decimal and thousands separators.The runtime also lost the vestigial ability to process GIF and BLP image formats, some existing assets were stealth GIFs with PNG extensions and have here been converted lossless to PNG.
The update check logic has been adapted to generate relative paths in the op-files to make its limited interpreter work correctly in exotic install locations.
Steps taken to verify a working solution:
Install location:
Build path:
Build name:
Numeric separators:
Settings.xml
,Link to a build that showcases this PR:
n/a
After screenshot: