DotNettled Ответов: 1

Проблема языка/кодовой страницы между приложением windows и службой windows


I have a Windows application and a Windows Service that both make calls to a common DLL. This common DLL spawns a process which generates my output. When run on a non-US Windows OS (zh-TW in this case) the Windows Application generates output as expected. When run as a Windows Service the output appears to be passed through a US code page as the output contains “boxes” used for non-mapped characters. This issue occurs even when the Service has a Log On As the same User that was used to run the Windows Application. There is something different in the initial environment in which the process is being launched as an application vs. service. Any information on what this difference is, and how to correct it, would be greatly appreciated.

Что я уже пробовал:

Я уже давно работаю с этим .Классы и настройки культуры сетевого потока, но не нашли ни одного, который изменил бы поведение вывода.

1 Ответов

Рейтинг:
1

RickZeeland

Может быть, это проблема с потоками, смотрите, как установить DefaultThreadCurrentCulture здесь: Установите культуру для всех потоков в приложениях C# » румынский кодер[^]