Commit 35f5299 1 parent aa1ba6d commit 35f5299 Copy full SHA for 35f5299
File tree 1 file changed +2
-40
lines changed
1 file changed +2
-40
lines changed Original file line number Diff line number Diff line change 16
16
17
17
extern " C" int aria2_main (int argc, char ** argv);
18
18
19
- #include < cstdint>
20
- #include < string>
21
- #include < vector>
22
-
23
- namespace
24
- {
25
- std::string ToMultiByteString (
26
- std::uint32_t CodePage,
27
- std::wstring_view const & InputString)
28
- {
29
- std::string OutputString;
30
-
31
- int OutputStringLength = ::WideCharToMultiByte (
32
- CodePage,
33
- 0 ,
34
- InputString.data (),
35
- static_cast <int >(InputString.size ()),
36
- nullptr ,
37
- 0 ,
38
- nullptr ,
39
- nullptr );
40
- if (OutputStringLength > 0 )
41
- {
42
- OutputString.resize (OutputStringLength);
43
- OutputStringLength = ::WideCharToMultiByte (
44
- CodePage,
45
- 0 ,
46
- InputString.data (),
47
- static_cast <int >(InputString.size ()),
48
- &OutputString[0 ],
49
- OutputStringLength,
50
- nullptr ,
51
- nullptr );
52
- OutputString.resize (OutputStringLength);
53
- }
54
-
55
- return OutputString;
56
- }
57
- }
19
+ #include < Mile.Helpers.CppBase.h>
58
20
59
21
int wmain (int argc, wchar_t ** argv)
60
22
{
@@ -63,7 +25,7 @@ int wmain(int argc, wchar_t** argv)
63
25
for (int i = 0 ; i < argc; ++i)
64
26
{
65
27
utf8_argv.push_back (::_strdup (
66
- ::ToMultiByteString (CP_UTF8, argv[i]).c_str()));
28
+ Mile::ToString (CP_UTF8, argv[i]).c_str ()));
67
29
}
68
30
utf8_argv.push_back (nullptr );
69
31
You can’t perform that action at this time.
0 commit comments