mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Windows: unicode command line
This commit is contained in:

committed by
Alexander Medvednikov

parent
93a3521a67
commit
0bbefca875
13
vlib/os/os.v
13
vlib/os/os.v
@ -93,8 +93,17 @@ fn todo_remove(){}
|
||||
|
||||
fn init_os_args(argc int, argv *byteptr) []string {
|
||||
mut args := []string
|
||||
for i := 0; i < argc; i++ {
|
||||
args << string(argv[i])
|
||||
$if windows {
|
||||
mut args_list := &voidptr(0)
|
||||
mut args_count := 0
|
||||
args_list = C.CommandLineToArgvW(C.GetCommandLine(), &args_count)
|
||||
for i := 0; i < args_count; i++ {
|
||||
args << string_from_wide(&u16(args_list[i]))
|
||||
}
|
||||
} $else {
|
||||
for i := 0; i < argc; i++ {
|
||||
args << string(argv[i])
|
||||
}
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
Reference in New Issue
Block a user