防止中文程序在英文系统上乱码

uses
  Windows;


在工程文件中添加一句代码,如下:

Application.Initialize;
//添加以下一句解决外文系统乱码问题
SetThreadLocale(DWORD(Word(SORT_DEFAULT) shl 16) or DWORD(Word(SUBLANG_CHINESE_SIMPLIFIED) shl 10) or DWORD(Word(LANG_CHINESE)));
Application.CreateForm(TForm1, Form1);
Application.Run;

posted @ 2022-08-19 13:01  小洋房  阅读(55)  评论(0编辑  收藏  举报