File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 11local platform = require ' bee.platform'
2- local unicode
2+ local windows
33
44if platform .OS == ' Windows' then
5- unicode = require ' bee.unicode '
5+ windows = require ' bee.windows '
66end
77
88local m = {}
99
1010function m .toutf8 (text )
11- if not unicode then
11+ if not windows then
1212 return text
1313 end
14- return unicode .a2u (text )
14+ return windows .a2u (text )
1515end
1616
1717function m .fromutf8 (text )
18- if not unicode then
18+ if not windows then
1919 return text
2020 end
21- return unicode .u2a (text )
21+ return windows .u2a (text )
2222end
2323
2424return m
Original file line number Diff line number Diff line change 1- local subprocess = require ' bee.subprocess'
2- local socket = require ' bee.socket'
31local util = require ' utility'
42local await = require ' await'
53local pub = require ' pub'
64local jsonrpc = require ' jsonrpc'
75local define = require ' proto.define'
86local json = require ' json'
97local inspect = require ' inspect'
10- local thread = require ' bee.thread '
8+ local platform = require ' bee.platform '
119local fs = require ' bee.filesystem'
1210local net = require ' service.net'
1311local timer = require ' timer'
234232function m .listen (mode , socketPort )
235233 m .mode = mode
236234 if mode == ' stdio' then
237- subprocess .filemode (io.stdin , ' b' )
238- subprocess .filemode (io.stdout , ' b' )
235+ if platform .OS == ' Windows' then
236+ local windows = require ' bee.windows'
237+ windows .filemode (io.stdin , ' b' )
238+ windows .filemode (io.stdout , ' b' )
239+ end
239240 io.stdin :setvbuf ' no'
240241 io.stdout :setvbuf ' no'
241242 pub .task (' loadProtoByStdio' )
You can’t perform that action at this time.
0 commit comments