Platform-independent code conversion within the C++ locale framework
2006 (English)In: Software, practice & experience, ISSN 0038-0644, E-ISSN 1097-024X, Vol. 36, no 15, 1643-1654 p.Article in journal (Refereed) Published
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.
Place, publisher, year, edition, pages
2006. Vol. 36, no 15, 1643-1654 p.
C plus, locale, code conversion
IdentifiersURN: urn:nbn:se:kth:diva-37483DOI: 10.1002/spe.734ISI: 000242699900001ScopusID: 2-s2.0-33845257537OAI: oai:DiVA.org:kth-37483DiVA: diva2:434043