From 8c5ec96695267f9d03d9078de722aa8df7bf5dd1 Mon Sep 17 00:00:00 2001 From: keita Date: Wed, 17 Feb 2021 14:02:06 +0900 Subject: [PATCH] =?UTF-8?q?URL=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E6=97=A5=E6=9C=AC=E8=AA=9E=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cocoatweet/util/util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cocoatweet/util/util.cc b/src/cocoatweet/util/util.cc index e8f777d..d3c7a2d 100644 --- a/src/cocoatweet/util/util.cc +++ b/src/cocoatweet/util/util.cc @@ -1,5 +1,6 @@ #include "cocoatweet/util/util.h" #include +#include namespace CocoaTweet::Util { std::string urlEncode(const std::string& _str) { @@ -10,7 +11,7 @@ std::string urlEncode(const std::string& _str) { (c == '.' || (c == '_') || (c == '-' || (c == '~')))) { out << c; } else { - out << '%' << std::hex << std::uppercase << static_cast(c); + out << '%' << std::setw(2) << std::setfill('0') << std::hex << std::uppercase << (0xFF & static_cast(c)); } }