-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace more %xy in mission names #1166
Conversation
IMO it would fit more to name this Edit: It's also known as percent encoding... but |
No DLL's in CBA, bux. |
…ce-HTML-displayed-missionNames
@@ -10,3 +10,222 @@ | |||
#endif | |||
|
|||
#include "\x\cba\addons\main\script_macros.hpp" | |||
|
|||
#define UTF8_TABLE [\ | |||
["%21","!"],\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are just ascii keycodes
https://community.bistudio.com/wiki/toString
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have any good way to translate i.e. %e2%80%98"
using toString
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this:
missionName
// "%c2%ac%c2%ae%c2%af%c2%b0%c2%b1%c2%b2%c2%b3%c2%b4%c2%b5%c2%b6%c2%b7%c2%b8%c2%b9%c2%ba%c2%bb%c2%bc%c2%bd%c2%be%c2%bf"
missionName call CBA_fnc_decodeURL
// "¬®¯°±²³´µ¶·¸¹º»¼½¾¿"
toString (missionName splitString "%" apply {call compile format ["0x%1", _x]} apply { _x})
// "¬®¯°±²³´µ¶·¸¹º»¼½¾¿"
So it is not exactly the same as ASCII codes. It seems to follow the UTF-8 conversion table instead:
https://www.w3schools.com/tags/ref_urlencode.asp
Except that % is encoded as %% and not %25.
Just noticed switching around terrains in the mission list visibly freezes my game. |
When merged this pull request will:
adds
CBA_fnc_decodeHTML
function replaces more %xy than %20 / space
Is there a difference between HTML and HTML URL? I am not sure about the function name.
Function doesn't work as is, because some functions are not defined in mission namespace in the briefing. Needs some fixing.
Will we do the complete HTML character list?