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

committed by
Alexander Medvednikov

parent
e25ea7f9dd
commit
8462e99bc5
@ -37,7 +37,11 @@ pub fn println(s string) {
|
||||
if isnil(s.str) {
|
||||
panic('println(NIL)')
|
||||
}
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
$if windows {
|
||||
C._putws(s.to_wide())
|
||||
} $else {
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn eprintln(s string) {
|
||||
@ -54,7 +58,11 @@ pub fn eprintln(s string) {
|
||||
}
|
||||
|
||||
pub fn print(s string) {
|
||||
C.printf('%.*s', s.len, s.str)
|
||||
$if windows {
|
||||
C.wprintf(s.to_wide())
|
||||
} $else {
|
||||
C.printf('%.*s', s.len, s.str)
|
||||
}
|
||||
}
|
||||
|
||||
__global total_m i64 = 0
|
||||
|
Reference in New Issue
Block a user