D2007下使用TEncoding类进行UNICODE、UTF8、UTF32格式转换?

Delphi 7环境下主流加密算法实现与应用实战 随着企业级应用对数据安全需求的不断提升,Delphi作为长期活跃于桌面与数据库系统的开发平台,广泛应用于金融、医疗、制造业等敏感领域。其加密技术不仅保障了配置文件、通信数据和存储信息的安全性,还支撑了合规性要求(如GDPR、等保)。Delphi通过调用原生函数、第三方库(如DCPcrypt、LockBox)实现对称加密、非对称加密与哈希算法,构建端到端的安全链路。典型场景包括:本地敏感数据保护、跨服务API通信加密、用户身份认证令牌生成等,为传统系统升级提供可落地的安全加固路径。 阅读详情

源码下载地址:http://www.rayfile.com/files/1f6d6517-eed9-11dd-8bce-0019d11a795f/

 

说明:参照Delphi2009的相关类,写了TEncoding类及继承类。重写了UTF16、UTF8、UTF32在Delphi2007下的字符处理方式,现在能进行这些格式的读写了。当然对于Delphi2007,读取UNICODE格式文字显示的时候有可能丢失字符。

 

 

 

 {* |<PRE>
================================================================================
* 软件名称:FcpEditor
* 单元名称:uEncoding
* 单元作者:Senfore
* 备    注:UNICODE读写支持
* 开发平台:Windows Xp Sp3 + Delphi 2007/Delphi2009
* 兼容测试:
* 本 地 化:使Delphi2007能使用Delphi2009的Encoding方式处理文本
* 单元标识:$Id: uEncoding.pas,v 1.1 2009/01/28
* 修改记录:
*           2009.01.28 V1.1
*               让Delphi2007环境下支持UTF32格式读写
*           2009.01.06 V1.0
*               创建单元,实现功能
================================================================================
|</PRE>}

unit uEncoding;

{$DEFINE UCS4_ENCODING_SUPPORT}

interface

uses Classes,Windows,SysUtils;

{$IFNDEF UNICODE}
function InterlockedCompareExchangePointer(var Destination: Pointer; Exchange: Pointer; Comperand: Pointer): Pointer;
{$ENDIF}

{$IFNDEF UNICODE}
type
   UnicodeString=WideString;
   RawByteString=AnsiString;
{$ENDIF}

 {$IFNDEF UNICODE}
type
  TCharArray = array of Char;

  EEncodingError = class(Exception);

  TEncoding = class
  strict private
    class var
      FASCIIEncoding: TEncoding;
      FBigEndianUnicodeEncoding: TEncoding;
      FDefaultEncoding: TEncoding;
      FUnicodeEncoding: TEncoding;
      FUTF7Encoding: TEncoding;
      FUTF8Encoding: TEncoding;
    class function GetASCII: TEncoding; static;
    class function GetBigEndianUnicode: TEncoding; static;
    class function GetDefault: TEncoding; static;
    class function GetUnicode: TEncoding; static;
    class function GetUTF7: TEncoding; static;
    class function GetUTF8: TEncoding; static;
  strict protected
    FIsSingleByte: Boolean;
    FMaxCharSize: Integer;
    function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; virtual; abstract;
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; virtual; abstract;
    function GetCharCount(Bytes: PByte; ByteCount: Integer): Integer; overload; virtual; abstract;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; virtual; abstract;
  public
    class function Convert(Source, Destination: TEncoding; Bytes: TBytes): TBytes; overload;
    class function Convert(Source, Destination: TEncoding; Bytes: TBytes; StartIndex, Count: Integer): TBytes; overload;
    class procedure FreeEncodings;
    class function IsStandardEncoding(AEncoding: TEncoding): Boolean; static;
    class function GetBufferEncoding(const Buffer: TBytes; var AEncoding: TEncoding): Integer; static;
    function GetByteCount(const Chars: TCharArray): Integer; overload;
    function GetByteCount(const Chars: TCharArray; CharIndex, CharCount: Integer): Integer; overload;
    function GetByteCount(const S: string): Integer; overload;
    function GetByteCount(const S: string; CharIndex, CharCount: Integer): Integer; overload;
    function GetBytes(const Chars: TCharArray): TBytes; overload;
    function GetBytes(const Chars: TCharArray; CharIndex, CharCount: Integer;
      var Bytes: TBytes; ByteIndex: Integer): Integer; overload;
    function GetBytes(const S: string): TBytes; overload;
    function GetBytes(const S: string; CharIndex, CharCount: Integer;
      var Bytes: TBytes; ByteIndex: Integer): Integer; overload;
    function GetCharCount(const Bytes: TBytes): Integer; overload;
    function GetCharCount(const Bytes: TBytes; ByteIndex, ByteCount: Integer): Integer; overload;
    function GetChars(const Bytes: TBytes): TCharArray; overload;
    function GetChars(const Bytes: TBytes; ByteIndex, ByteCount: Integer): TCharArray; overload;
    function GetChars(const Bytes: TBytes; ByteIndex, ByteCount: Integer;
      var Chars: TCharArray; CharIndex: Integer): Integer; overload;
    class function GetEncoding(CodePage: Integer): TEncoding; static;
    function GetMaxByteCount(CharCount: Integer): Integer; virtual; abstract;
    function GetMaxCharCount(ByteCount: Integer): Integer; virtual; abstract;
    function GetPreamble: TBytes; virtual; abstract;
    function GetString(const Bytes: TBytes): string; overload;
    function GetString(const Bytes: TBytes; ByteIndex, ByteCount: Integer): string; overload;
    class property ASCII: TEncoding read GetASCII;
    class property BigEndianUnicode: TEncoding read GetBigEndianUnicode;
    class property Default: TEncoding read GetDefault;
    property IsSingleByte: Boolean read FIsSingleByte;
    class property Unicode: TEncoding read GetUnicode;
    class property UTF7: TEncoding read GetUTF7;
    class property UTF8: TEncoding read GetUTF8;
  end;

 TMBCSEncoding = class(TEncoding)
  private
    FCodePage: Cardinal;
    FMBToWCharFlags: Cardinal;
    FWCharToMBFlags: Cardinal;
  strict protected
    function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetCharCount(Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; override;
  public
    constructor Create; overload; virtual;
    constructor Create(CodePage: Integer); overload; virtual;
    constructor Create(CodePage, MBToWCharFlags, WCharToMBFlags: Integer); overload; virtual;
    function GetMaxByteCount(CharCount: Integer): Integer; override;
    function GetMaxCharCount(ByteCount: Integer): Integer; override;
    function GetPreamble: TBytes; override;
  end;

  TUTF7Encoding = class(TMBCSEncoding)
  strict protected
    function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetCharCount(Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; override;
  public
    constructor Create; override;
    function GetMaxByteCount(CharCount: Integer): Integer; override;
    function GetMaxCharCount(ByteCount: Integer): Integer; override;
  end;

  TUTF8Encoding = class(TUTF7Encoding)
  public
    constructor Create; override;
    function GetMaxByteCount(CharCount: Integer): Integer; override;
    function GetMaxCharCount(ByteCount: Integer): Integer; override;
    function GetPreamble: TBytes; override;
  end;

  TUnicodeEncoding = class(TEncoding)
  strict protected
    function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetCharCount(Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; override;
  public
    constructor Create; virtual;
    function GetMaxByteCount(CharCount: Integer): Integer; override;
    function GetMaxCharCount(ByteCount: Integer): Integer; override;
    function GetPreamble: TBytes; override;
  end;

  TBigEndianUnicodeEncoding = class(TUnicodeEncoding)
  strict protected
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; override;
  public
    function GetPreamble: TBytes; override;
  end;

  TStringsEx=class(TStrings)
  private

  public
    procedure LoadFromFile(const FileName: string); overload; virtual;
    procedure LoadFromFile(const FileName: string; Encoding: TEncoding); overload; virtual;
    procedure LoadFromStream(Stream: TStream); overload; virtual;
    procedure LoadFromStream(Stream: TStream; Encoding: TEncoding); overload; virtual;
    procedure SaveToFile(const FileName: string); overload; virtual;
    procedure SaveToFile(const FileName: string; Encoding: TEncoding); overload; virtual;
    procedure SaveToStream(Stream: TStream); overload; virtual;
    procedure SaveToStream(Stream: TStream; Encoding: TEncoding); overload; virtual;
  end;

{ TStringList class }
  TStringListEx = class;
  TStringListExSortCompare = function(List: TStringListEx; Index1, Index2: Integer): Integer;

  TStringListEx = class(TStringsEx)
  private
    FList: PStringItemList;
    FCount: Integer;
    FCapacity: Integer;
    FSorted: Boolean;
    FDuplicates: TDuplicates;
    FCaseSensitive: Boolean;
    FOnChange: TNotifyEvent;
    FOnChanging: TNotifyEvent;
    procedure ExchangeItems(Index1, Index2: Integer);
    procedure Grow;
    procedure QuickSort(L, R: Integer; SCompare: TStringListExSortCompare);
    procedure SetSorted(Value: Boolean);
    procedure SetCaseSensitive(const Value: Boolean);
  protected
    procedure Changed; virtual;
    procedure Changing; virtual;
    function Get(Index: Integer): string; override;
    function GetCapacity: Integer; override;
    function GetCount: Integer; override;
    function GetObject(Index: Integer): TObject; override;
    procedure Put(Index: Integer; const S: string); override;
    procedure PutObject(Index: Integer; AObject: TObject); override;
    procedure SetCapacity(NewCapacity: Integer); override;
    procedure SetUpdateState(Updating: Boolean); override;
    function CompareStrings(const S1, S2: string): Integer; override;
    procedure InsertItem(Index: Integer; const S: string; AObject: TObject); virtual;
  public
    destructor Destroy; override;
    function Add(const S: string): Integer; override;
    function AddObject(const S: string; AObject: TObject): Integer; override;
    procedure Clear; override;
    procedure Delete(Index: Integer); override;
    procedure Exchange(Index1, Index2: Integer); override;
    function Find(const S: string; var Index: Integer): Boolean; virtual;
    function IndexOf(const S: string): Integer; override;
    procedure Insert(Index: Integer; const S: string); override;
    procedure InsertObject(Index: Integer; const S: string;
      AObject: TObject); override;
    procedure Sort; virtual;
    procedure CustomSort(Compare: TStringListExSortCompare); virtual;
    property Duplicates: TDuplicates read FDuplicates write FDuplicates;
    property Sorted: Boolean read FSorted write SetSorted;
    property CaseSensitive: Boolean read FCaseSensitive write SetCaseSensitive;
    property OnChange: TNotifyEvent read FOnChange write FOnChange;
    property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
  end;

  {$ENDIF}

{$IFDEF UCS4_ENCODING_SUPPORT}
type
  TUCS4Encoding = class(TEncoding)
  strict protected
    FBOMEnable: Boolean;
    FBigEndian: Boolean;
    function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;
    function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetCharCount(Bytes: PByte; ByteCount: Integer): Integer; overload; override;
    function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; overload; override;
  public
    constructor Create; overload; virtual;
    constructor Create(BigEndian: Boolean); overload; virtual;
    constructor Create(BigEndian, BOMEnable: Boolean); overload; virtual;
    function GetMaxByteCount(CharCount: Integer): Integer; override;
    function GetMaxCharCount(ByteCount: Integer): Integer; override;
    function GetPreamble: TBytes; override;
  end;

{$ENDIF UCS4_ENCODING_SUPPORT}

{CheckBom}
  function HasUTF16LEBOM(S: TStream): Boolean; overload;
  function HasUTF16LEBOM(S: AnsiString): Boolean; overload;
  function HasUTF16BEBOM(S: TStream): Boolean; overload;
  function HasUTF16BEBOM(S: AnsiString): Boolean; overload;
  function HasUTF8BOM(S: TStream): Boolean; overload;
  function HasUTF8BOM(S: AnsiString): Boolean; overload;
  function HasUTF32LEBOM(S: TStream): Boolean; overload;
  function HasUTF32LEBOM(S: AnsiString): Boolean; overload;
  function HasUTF32BEBOM(S: TStream): Boolean; overload;
  function HasUTF32BEBOM(S: AnsiString): Boolean; overload;
{Encoding}
  function GetEncodeFromStream(Stream: TStream;var CodePage:LongInt): Boolean;
  function GetCodePageFromFile(const FileName:TFileName;var DefCodePage:LongInt):Boolean;
  function GetEncoding(CodePage: Integer): TEncoding;
  function GetEnCodingFromFile(const FileName:TFileName;DefCodePage:LongInt=0):TEncoding;
{File<->Str}
  function StrToFile(const FileName, S: String): Boolean;overload;
  function StrToFile(const FileName, S: String;Encoding:TEncoding): Boolean;overload;
  procedure StrSaveToStream(const S:string;Stream: TStream; Encoding: TEncoding);
  function FileToStr(const FileName: string):string;overload;
  function FileToStr(const FileName: string; Encoding: TEncoding):string;overload;
  function FileToString(const FileName: string): RawByteString;
  function StrLoadFromStream(Stream: TStream; Encoding: TEncoding):string;
{Unicode}
  function UnicodeEncode(Str: string; CodePage: integer): WideString;
  function UnicodeDecode(Str: WideString; CodePage: integer): string;
  function Gb2Big5(Str: string): string;
  function Big52Gb(Str: string): string;
  function GBCHT2CHS(const S: string): string;
  function GBCHS2CHT(const S: string): string;

 

 

 

 

delphi-string互相转化为byte数组 立即下载

相关推荐

Delphi7AES加密解密与JAVA互转(默认128位+ECB+PKCS5Padding+先BASE64再HEX)

Delphi7AES加密解密与JAVA互转(默认128位+ECB+PKCS5Padding+先BASE64再HEX)

Delphi与字符编码(实战篇)

Delphi与字符编码(实战篇) Posted on 2008-01-05 22:39 保权 阅读(136) 评论(0)  编辑  收藏 所属分类: 字符编码 、Delphi <!--<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:dc="http://purl.org/dc/elemen

jiljil的专栏 3596

模电学习笔记(十二)——跨阻放大器

模电学习笔记(十二) 跨阻放大器 跨组运算放大器是将电流信号转换成为电压信号,电流到电压增益基于反馈电阻。 设计目标: 输入 输出 带宽 电源 0A 100uA 0V 7V 20kHz 15V -15V 1.计算R1的值(增益电阻器) 2.计算C1的值满足电路带宽 ...

tang11081023的博客 2万+

delphi TEncoding

#include &lt;tchar.h&gt; #include &lt;memory&gt; //For STL auto_ptr class //--------------------------------------------------------------------------- #pragma argsused int _tmain(int a...

weixin_33825683的博客 1674

数学之美 | 图论和网络爬虫

文章目录概述图论网络爬虫分析BFSDFSBFS + DFS参考资料 概述 这篇文章主要给大家介绍一下计算机算法中非常重要的一部分——图论,以及它在生活中的应用——网络爬虫。   图论 离散数学是当代数学的一个重要的分支,也是计算机科学的数学基础。它又包括四个分支,而图论便是其中一支,另外三个分别是:数理逻辑、集合论、近代数学。 图论中的图由一些节点和边构成,比如下面这张图 。 在图论中一个很基础...

小小酥梨的博客 3233

深入解析fio Benchmark测试:从源码到实践

本文深入解析fio Benchmark测试工具,从入门指南到源码架构分析,详细介绍了其核心模块、关键数据结构和I/O处理机制。通过实战案例展示如何优化存储性能测试,包括内存对齐、多线程调优等技巧,帮助开发者充分利用fio进行精准的存储性能评估。

weixin_42563415的博客 211

(delphi11最新学习资料) Object Pascal 学习笔记---第6章第4节(字符串及编码 )

对于更高级别的 ANSI 字符,没有直接的映射,必须使用特定的编码进行转换(然而,对于多字节的 UTF-8 元素,转换将失败)。编码类允许您进行双向转换;​ 要在不同格式(或编码)之间转换文件和内存数据,Object Pascal RTL 有一个名为 TEncoding 类,与它几个继承类一起定义在 System.SysUtils 单元中。​ 正如我们所看到的,Object Pascal中的字符串类型映射到Unicode UTF-16格式,每个元素2字节,并管理BMP(基本多语言平面)之外码点的代理对。

langfengyl的专栏 701

从零到一:Admin.NET中Swagger与Knife4jUI的深度集成实践

本文详细介绍了在Admin.NET框架中深度集成Swagger与Knife4jUI的实践方法,从基础配置到高级定制,包括认证配置、安全增强、界面主题定制等。通过Furion框架简化配置,开发者可以快速构建专业且友好的API文档界面,提升团队协作效率。

defi6farmer的博客 409

Delphi 编码错误问题

编码格式错误、GBK转UTF8

m0_58498198的博客 2377

USB3.0 Type-B连接器SSTX/SSRX信号定义常见错误与硬件设计避坑指南

本文详细解析了USB3.0 Type-B连接器中SSTX/SSRX信号的定义标准与常见设计错误。针对连接器厂商图纸可能出现的信号标识错误,提供了实用的排查方法和硬件设计避坑指南,帮助工程师避免因引脚定义颠倒导致的通信降级或故障,确保USB3.0高速传输的稳定性。

gg901的博客 1284

DySAT+: Enhancing Dynamic Graph Representation Learning with Multi-Head Self-Attention and Temporal-

本文深入探讨了DySAT+模型在动态图表示学习中的创新应用,通过多头时空注意力机制和层级信息融合策略,有效解决了动态图数据中的时间维度信息捕捉和结构演变动态适应问题。该模型在社交网络异常检测和金融交易网络分析等场景中表现出色,显著提升了预测准确率和响应速度。

weixin_29035405的博客 345

解决delphi indy10下 utf8码转换的问题

用delphi2010调试一个以前的程序,因为以前的程序是delphi7下编写的,大家都知道delphi7下的用的是indy9,后面的主流版本都是用indy10啦。 所以以前用的Temp1 := UTF8Decode(Temp); Temp1 := Utf8ToAnsi(Temp); Temp1 := UTF8Decode(Temp); Temp1 := UTF8Encode(Temp)...

一切若然 1643

电压抬升电路设计

一、实验目的 掌握集成运放电压放大电路设计基本方法。 掌握基本仪器使用方法(电源、信号发生器、示波器)。 二、实验内容及结果 实验内容 基于集成运放设计一传感器信号采集电路。传感器输出信号在±50mV,频率为100Hz以内,模数转换器允许输入电压在0~5V,要求设计传感器与模数转换器之间的信号采集电路,实现传感器信号放大10倍,并适合模数转换器的输入。模数转换器的输入电阻为1KHz,设计电路时,可使用1KHz电阻作为信号采集电路负载,代替模数转换器。 实验具体要求如下: (1)确定电路形式,说明电压转

Safaearth的博客 4万+

如何解决delphi2007中UTF-8转码的奇数汉字出错的问题

很多人遇到这个问题,就是奇数个转码为UTF-8格式后,转换回来就出问题。 我用delphi2007也遇到这种情况,delphi自带的widestringtoUTF8遇到奇数汉字直接返回空值。用windows自带的转换函数会丢掉最后一个汉字。 原因是UTF-8的汉字每个都是三个字节,奇数个汉字就是奇数个字节,而转码时每次是处理两个字节,这样就会剩下一个字节,这个字节会被置为‘?’。 网上有很多

gevyaa的专栏 1382

Unity Shader之路(一)什么是Unity Shader?

Unity Shader前言什么是UnityShaderUnity Shader和材质的关系 前言 众所周知,要想当游戏开发工程师,Unity中的Shader编写不得不摸,这一系列文章我将描写我的Shader学习之路,致敬冯乐乐的书Unity Shader入门精要,此篇什么是Unity Shader?希望能给后人一点方向 我们刚开始接触Unity的时候,总是会遇到材质,但是不了解材质都是什么,为什么可以在很多材质中选择,为什么有时候选择了其他材质后就不能达到我们想要的结果,为什么资源商店有那么多的材质,山.

TurboQ珞珈 2249

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

当Delphi支持了Unicode,它将会变成什么样子呢?

 当Delphi支持了Unicode,它将会变成什么样子呢?我的看法如下:1. 开发变得复杂了,因为要更多的考虑编码问题2. 绝大多数控件都需要修改,以使其能适应Delphi20093. 多国语言的软件得到了较好的支持第一点和第二点,相信很多人都有体会了,原本在Delphi2007上通顺利编译通过的项目,放到Delphi2009上就要进行很大的改动。特别是API的调用,MessageBoxA改

Hopping的专栏 3023

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

delph 自带URL编码函数 TNetEncoding

UTF-8编码 sKey := TNetEncoding.URL.Encode('中文', [], [], TEncoding.UTF8); %E4%B8%AD%E6%96%87 GBK编码 sKey := TNetEncoding.URL.Encode('中文', [], [], TEncoding.ANSI); %D6%D0%CE%C4

重楼的博客 1189

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

delphi html 乱码,delphi 获得网页乱码

Delphi7里idhttp(UTF-8网页)乱码的话可以用UTF8Decode()函数解决例如:Memo1.text:=UTF8Decode(idhttp1.get(**));但到了delphi2010里在用UTF8Decode这个函数转换就不行还是会乱码所以我们可以这样procedureTForm1.SpeedButton1Click(Sender:TObject);VarcText:...

weixin_32771227的博客 928

ARC自动引用计数与方法function过程procedure的传参的对象类型及其回调值

ARC自动引用计数与方法function过程procedure的传参的对象类型及其回调值 一、ARC自动引用计数:Auto Reference counting 二、对象类型 任何对象的数据类别,其存在的形式都有四种可能: 2.1、const(显式的常量),即:const L: <T> ; 2.2、var(显式的变量),即:var L: <T> ; 2....

pulledup的博客 484

Delphi XE 的一些新类

TCharacter类 完全由私人类静态函数组成。开发人员并不需要实例TCharacter,相反,最好只调用它的静态方法。这个类包括: 字符转换为大写或小写,确定什么样的类型属,也就是说,这个数字是字母,标点符号,或别的东西。 TCharacter使用由Unicode协会规定的标准。 下面的代码: uses Character;begin if MyChar in [‘a’...’z’, ‘A’...’Z’] then begin   ... end; end;可以很容易地被替换如下:

jn_child的专栏 1710

delphi2007 读取得unicode文本显示出来时乱码?

正好今天在编程序,把我写的读写unicode及utf-8的函数上传到这里。 utf8Head:   Array[0..2] of Char = (#239,#$bb,#$bf); unicodeHead: Array[0..1] of Char = (#255,#$fe); // read utf8 file function ReadUtf8File(const filena

jacknes009的专栏 1963

Lazarus 中文汉字解决方案

使用Lazarus不得不面对编码问题,尤其中文。Lazarus使用的是UTF8编码,而很多windows程序使用的是ANSI编码,编码问题在此不多说大家可以google去。ANSI数据库与Lazarus编程的解决方法:1.全局设置一个isNeedANSI变量;2.从数据库读取时:function Tdmd.FromDBStr(str:string):string;beginif IsNeedANS...

weixin_30562507的博客 1111
上一篇: FcpEditor(Ansi)v2.1.0.70
下一篇: 非模式窗体中的可编辑控件无法响应LEFT、RIGHT、UP、DOWN、HOME、END、CTRL+V等按键的解决办法!
senfore
博客等级 码龄23年 5粉丝 34原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址