首页> 外文期刊>Software >Platform-independent code conversion within the C++ locale framework
【24h】

Platform-independent code conversion within the C++ locale framework

机译:C ++语言环境框架中与平台无关的代码转换

获取原文
获取原文并翻译 | 示例
           

摘要

This paper describes some of the author's experiences from a C++ implementation of a concordance program for texts in Old West Norse (also known as Old Icelandic) and Runic Swedish. Since the input to the program used a character repertoire that no standard one-byte character encoding covers, it was natural to use Unicode to represent data both inside the program and in external files. Inside the program, each character was represented with C++ 'wide characters'; the input and output was represented in UTF-8. The author constructed C++ code conversion facets that convert data between those two representations during file I/O. This enabled him to successfully compile, and run, the concordance program on both Linux (Fedora Core 3 with gcc 3.4.2) and Windows XP (using Visual C++ .NET 2003). The only necessary change to the source when changing platform was isolated to the lines selecting which code conversion facet to use—all other pieces of code remained unchanged. In particular, the author could still use the standard C++ locale framework for collation and code conversion, in spite of the fact that the library-provided code conversion facets had been replaced.
机译:本文介绍了作者在旧西部北欧语(也称为旧冰岛语)和符文瑞典语的文本的协调程序的C ++实现中的一些经验。由于程序输入使用的字符表没有标准的一字节字符编码覆盖,因此使用Unicode表示程序内部和外部文件中的数据是很自然的。在程序内部,每个字符都用C ++的“宽字符”表示。输入和输出以UTF-8表示。作者构建了C ++代码转换方面,可在文件I / O期间在这两种表示之间转换数据。这使他能够在Linux(使用gcc 3.4.2的Fedora Core 3)和Windows XP(使用Visual C ++ .NET 2003)上成功编译并运行该一致性程序。当更改平台时,对源的唯一必要更改被隔离在选择使用哪个代码转换构面的行中,而其他所有代码段均保持不变。特别是,尽管已替换了库提供的代码转换方面,但作者仍可以使用标准的C ++语言环境框架进行排序和代码转换。

著录项

  • 来源
    《Software》 |2006年第15期|p.1643-1654|共12页
  • 作者

    Lars Engebretsen;

  • 作者单位

    Department of Numerical Analysis and Computer Science, Royal Institute of Technology, SE-100 44 Stockholm, Sweden;

  • 收录信息 美国《科学引文索引》(SCI);美国《工程索引》(EI);
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类 计算机软件;
  • 关键词

    C++; locale; code conversion;

    机译:C ++;语言环境;代码转换;

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号