2016-01-07 08:14:33 +00:00
|
|
|
#pragma once
|
2015-10-08 11:04:42 +00:00
|
|
|
|
2019-01-16 00:46:42 +00:00
|
|
|
namespace nall::Encode {
|
2015-10-08 11:04:42 +00:00
|
|
|
|
Update to v106r59 release.
byuu says:
Changelog:
- fixed bug in Emulator::Game::Memory::operator bool()
- nall: renamed view<string> back to `string_view`
- nall:: implemented `array_view`
- Game Boy: split cartridge-specific input mappings (rumble,
accelerometer) to their own separate ports
- Game Boy: fixed MBC7 accelerometer x-axis
- icarus: Game Boy, Super Famicom, Mega Drive cores output internal
header game titles to heuristics manifests
- higan, icarus, hiro/gtk: improve viewport geometry configuration;
fixed higan crashing bug with XShm driver
- higan: connect Video::poll(),update() functionality
- hiro, ruby: several compilation / bugfixes, should get the macOS
port compiling again, hopefully [Sintendo]
- ruby/video/xshm: fix crashing bug on window resize
- a bit hacky; it's throwing BadAccess Xlib warnings, but they're
not fatal, so I am catching and ignoring them
- bsnes: removed Application::Windows::onModalChange hook that's no
longer needed [Screwtape]
2018-08-26 06:49:54 +00:00
|
|
|
inline auto URL(string_view input) -> string {
|
2015-10-08 11:04:42 +00:00
|
|
|
string output;
|
|
|
|
for(auto c : input) {
|
2016-10-27 21:16:58 +00:00
|
|
|
//unreserved characters
|
2015-10-08 11:04:42 +00:00
|
|
|
if(c >= 'A' && c <= 'Z') { output.append(c); continue; }
|
|
|
|
if(c >= 'a' && c <= 'z') { output.append(c); continue; }
|
|
|
|
if(c >= '0' && c <= '9') { output.append(c); continue; }
|
|
|
|
if(c == '-' || c == '_' || c == '.' || c == '~') { output.append(c); continue; }
|
2016-10-27 21:16:58 +00:00
|
|
|
|
|
|
|
//special characters
|
2015-10-08 11:04:42 +00:00
|
|
|
if(c == ' ') { output.append('+'); continue; }
|
2016-10-27 21:16:58 +00:00
|
|
|
|
|
|
|
//reserved characters
|
|
|
|
uint hi = (c >> 4) & 15;
|
|
|
|
uint lo = (c >> 0) & 15;
|
2015-10-08 11:04:42 +00:00
|
|
|
output.append('%');
|
|
|
|
output.append((char)(hi < 10 ? ('0' + hi) : ('a' + hi - 10)));
|
|
|
|
output.append((char)(lo < 10 ? ('0' + lo) : ('a' + lo - 10)));
|
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2019-01-16 00:46:42 +00:00
|
|
|
}
|