Skip to content

Commit 79f1680

Browse files
author
jan.nijtmans
committed
When generating stubs, always read *.decls and *Decls.h files in UTF-8. This corrects possible invalid UTF-8.
1 parent 1f181f6 commit 79f1680

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/genStubs.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ proc genStubs::rewriteFile {file text} {
257257
return
258258
}
259259
set in [open ${file} r]
260+
fconfigure $in -eofchar "\032 {}" -encoding utf-8
260261
set out [open ${file}.new w]
261-
fconfigure $out -translation lf
262+
fconfigure $out -translation lf -encoding utf-8
262263

263264
while {![eof $in]} {
264265
set line [gets $in]
@@ -1191,7 +1192,7 @@ proc genStubs::init {} {
11911192
set outDir [lindex $argv 0]
11921193

11931194
foreach file [lrange $argv 1 end] {
1194-
source $file
1195+
source -encoding utf-8 $file
11951196
}
11961197

11971198
foreach name [lsort [array names interfaces]] {

0 commit comments

Comments
 (0)