Closed YihaoPeng closed 6 years ago
Thank you! I'll do some quick manual testing to make sure there are no regressions and upload a new version to Nexus.
I got stuck on the "System.IO.IOException: invalid handle" when setting the InputEncoding and hadn't found a way to fix that.
dsn_plugin
sent its command asUTF-8
encoded butdsn_service
recieved it byANSI
(it will beGBK
/cp936
when the system language isSimplified Chinese
). So any non-ASCII characters will be garbled and speech recognition does not work at all when your game language isTraditional Chinese
orSimplified Chinese
.I fixed the issue by adding a new param
--encoding
todsn_service
and set it beUTF-8
whendsn_plugin
starting the service.Now
dsn_service
is a console application because a Windows application cannot setInputEncoding
, aSystem.IO.IOException: invalid handle
will be threw.And, because
dsn_service
is a console application, we can run it directly and input our commands to test. (Without the param, both console anddsn_service
's encoding areANSI
so characters garbled will not happen.)It has no additional disadvantages. I have modified the
dsn_plugin
to hide the console window. And whenSkyrim
exited,dsn_service
can exit normally.Now it works well with my SkyrimVR and Chinese Translation Mod. Official Traditional Chinese and English work well too.