mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Add support for data: URIs (#62)
Add support for data: URIs. Code conversion renaming (GBK->ACP).
This commit is contained in:
1 parent
b818df6ac8
commit
b950260e68
13 files changed
+63
-17
No files matched your search
+7
-2
@@ -54,7 +54,8 @@ void sleep(int interval)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(interval));
|
||||
}
|
||||
|
||||
std::string GBKToUTF8(std::string str_src)
|
||||
// ANSI code page (GBK on 936) to UTF8
|
||||
std::string ACPToUTF8(std::string str_src)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const char* strGBK = str_src.c_str();
|
||||
@@ -77,7 +78,8 @@ std::string GBKToUTF8(std::string str_src)
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
std::string UTF8ToGBK(std::string str_src)
|
||||
// UTF8 to ANSI code page (GBK on 936)
|
||||
std::string UTF8ToACP(std::string str_src)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const char* strUTF8 = str_src.data();
|
||||
@@ -113,6 +115,8 @@ void StringToWstring(std::wstring& szDst, std::string str)
|
||||
//std::wstring r = wszUtf8;
|
||||
delete[] wszUtf8;
|
||||
}
|
||||
#else
|
||||
/* Unimplemented: std::codecvt_utf8 */
|
||||
#endif // _WIN32
|
||||
|
||||
unsigned char ToHex(unsigned char x)
|
||||
@@ -660,6 +664,7 @@ std::string getMD5(std::string data)
|
||||
return result;
|
||||
}
|
||||
|
||||
// TODO: Add preprocessor option to disable (open web service safety)
|
||||
std::string fileGet(std::string path, bool binary, bool scope_limit)
|
||||
{
|
||||
std::ifstream infile;
|
||||
|
||||
Reference in new issue
Block a user