ae.utils.iconv

Code to convert strings from a few common codepages to UTF-8. Loosely based on https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/characterencodings.d

Members

Functions

hasHighAsciiChars
bool hasHighAsciiChars(ascii data)

True if data contains non-ASCII characters.

hasHighAsciiChars
deprecated bool hasHighAsciiChars(ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
stripNonAscii
string stripNonAscii(ascii data)

Replaces non-ASCII characters (with the high bit set) with the Unicode replacement character.

toUtf8
string toUtf8(ascii data, string cp, bool force)

Convert text in an arbitrary (known) encoding to UTF-8.

toUtf8
deprecated string toUtf8(ubyte[] data, string cp, bool force)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

codepages
wstring[string] codepages;

High part of known 8-bit code pages.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>