Skip to content

Commit

Permalink
miscutil: Fix percent encoding to use uppercase (#885)
Browse files Browse the repository at this point in the history
文字列をパーセントエンコーディングに変換する処理で16進数表記のA-Fを
小文字から大文字に変更します。RFC3986[1]では大文字を使うべきと
書かれています。

> For consistency, URI producers and normalizers should use uppercase
> hexadecimal digits for all percent-encodings.

修正にあたり不具合報告をしていただきありがとうございました。
https://next2ch.net/test/read.cgi/linux/1613035222/557
https://mao.5ch.net/test/read.cgi/linux/1615781919/869

[1]: https://datatracker.ietf.org/doc/html/rfc3986#section-2.1
  • Loading branch information
ma8ma committed Dec 22, 2021
1 parent 3e5a034 commit 45202ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jdlib/miscutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ std::string MISC::url_encode( const char* str, const size_t n )
( c != '@' ) &&
( c != '_' )){

snprintf( str_tmp, tmplng , "%%%02x", c );
std::snprintf( str_tmp, tmplng, "%%%02X", c );
}
else {
str_tmp[ 0 ] = c;
Expand Down

0 comments on commit 45202ac

Please sign in to comment.