使用Indy 10.5.9在Windows上启用和使用iconv的步骤 [英] Steps to enable and use iconv on Windows with Indy 10.5.9

查看:285
本文介绍了使用Indy 10.5.9在Windows上启用和使用iconv的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要使用Internet Direct(Indy)进行跨平台开发,启用 iconv 支持,而不是特定于操作系统的Windows字符转换。

For cross-platform development with Internet Direct (Indy), it can be useful to enable iconv support instead of the OS-specific Windows character conversions.

这将允许在Delphi IDE中继续开发和测试Windows上的代码,但仍然可以找到转换

This would allow to continue developing and testing code on Windows in the Delphi IDE, but still be able to find conversion related issues before compiling the code on a different platform.

Indy 10已经包含在Linux和Windows上使用iconv API的代码。

在Windows上,需要进行一些准备:

On Windows, some preparation is required:


  • 将iconv API DLL复制到应用文件夹或搜索路径

  • 定义 use_iconv 条件符号

  • copy the iconv API DLL to the app folder or the search path
  • define the use_iconv conditional symbol

这个问题的意图是帮助Windows平台上开始使用iconv。

The intention of this question is to help getting started with iconv on the Windows platform.

推荐答案

免费Pascal有一个iconv标题(package iconvenc),或者是delphi兼容或应该是易于更新。从 FPC websvn界面模块iconvenc 或最新的RC(2.6.2rc1),因为它可能从2.6.0以前更新。

Free Pascal has an iconv header (package iconvenc), and that either is delphi compatible or should be easily updatable. Get it from FPC websvn interface module iconvenc or the latest RC (2.6.2rc1), since it might have updated since the year old 2.6.0.

但它更复杂不仅仅是提供标题,因为Windows上的iconv不支持errno,因此不能处理EILSEQ和EI2BIG,所以你需要正确地分配内存(如4 * charsize)。

But it is more complicated than just providing the header, since iconv on windows doesn't support errno, and thus can't handle EILSEQ and EI2BIG, so you need to properly allocate memory up front (like 4*charsize).

我有代码如何处理非errno iconv目标 PHP ,但是还没有很好的测试。 (见src / iconvert.inc)

I got code how to handle non errno iconv targets PHP, but it hasn't been tested very well. (see src/iconvert.inc)

这篇关于使用Indy 10.5.9在Windows上启用和使用iconv的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆