相关疑难解决方法(0)

什么可能导致"目标多字节代码页中不存在Unicode字符的映射"?

我有一个EurekaLog错误报告显示EEncodingError.日志指向TFile.AppendAllText.我打电话TFile.AppendAllText是我的这个程序:

procedure WriteToFile(CONST FileName: string; CONST uString: string; CONST WriteOp: WriteOpperation; ForceFolder: Boolean= FALSE);     // Works with UNC paths
begin
 if NOT ForceFolder
 OR (ForceFolder AND ForceDirectoriesMsg(ExtractFilePath(FileName))) then
   if WriteOp= (woOverwrite)
   then IOUtils.TFile.WriteAllText (FileName, uString)
   else IOUtils.TFile.AppendAllText(FileName, uString);
end;
Run Code Online (Sandbox Code Playgroud)

这是来自EurekaLog的信息.

在此输入图像描述

在此输入图像描述

是什么导致这种情况发生?

delphi unicode delphi-xe7

12
推荐指数
1
解决办法
1万
查看次数

如何在Delphi中将字符串保存到文本文件中?

创建字符串并将其保存到.txt文件中的最简单方法是什么?

delphi text-files

11
推荐指数
3
解决办法
2万
查看次数

如何读取UTF8编码的INI文件?

我有一个UTF-8格式的INI文件.

我正在使用Delphi 2010读取INI文件并使用INI文件中的值填充TStringGrid.

var
  ctr : Integer;
  AppIni : TIniFile;
begin
  AppIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'test.ini');
    for ctr := 1 to StringGrid1.RowCount do begin
        StringGrid1.Cells[0,ctr] := AppIni.ReadString('Column1','Row'+IntToStr(ctr),'');
        StringGrid1.Cells[1,ctr] := AppIni.ReadString('Column2','Row'+IntToStr(ctr),'');
    end;
  AppIni.Free;
Run Code Online (Sandbox Code Playgroud)

问题是unicode字符出现在TStringGrid中,显示2个字符,而不是1个unicode字符.

我该如何解决这个问题?

delphi delphi-2010

11
推荐指数
1
解决办法
6980
查看次数

System.IOUtils.TDirectory.GetParent 奇怪的行为?

的结果GetParent('c:\1\2\')'c:\1\2'

的结果GetParent('c:\1\2')'c:\1'

这是正常/预期的行为吗?如果是,其背后的逻辑是什么?

delphi

3
推荐指数
1
解决办法
404
查看次数

标签 统计

delphi ×4

delphi-2010 ×1

delphi-xe7 ×1

text-files ×1

unicode ×1