1
0
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:
vitalyster
2019-07-24 00:40:24 +03:00
committed by Alexander Medvednikov
parent e25ea7f9dd
commit 8462e99bc5
7 changed files with 207 additions and 63 deletions

View File

@ -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