icu4d.helper
Helper of encode/decode
Examples:
import icu4d; // register EncodingScheme.register!(ICUEncodingSchemeImpl!"Shift_JIS"); auto textpart = "ごん、お前だったのか。いつも栗をくれたのは"; auto sjistext = textpart.encodeText!"Shift_JIS"(); auto utf16text = textpart.encodeText!"UTF-16LE"(); assert(sjistext.decodeText!"Shift_JIS"() == utf16text.decodeText!"UTF-16LE"());
- void
decodeText
(Range)(const(ubyte)[] src, auto ref Range dst, string charsetName = null)
if(!isSomeString!Range && isOutputRange!(Range, dchar));
voiddecodeText
(Str)(in ubyte[] src, ref Str dst, string charsetName = null)
if(isSomeString!Str);
stringdecodeText
(in ubyte[] src, string charsetName = null);
autodecodeText
(string charsetName, Args...)(auto ref Args args); - alias
fromMBS
= decodeText(Range)(const(ubyte)[] src, auto ref Range dst, string charsetName = null) if (!isSomeString!Range && isOutputRange!(Range, dchar)); - void
encodeText
(Src, Range)(Src src, auto ref Range dst, string charsetName = null)
if(isSomeString!Src && isOutputRange!(Range, ubyte));
voidencodeText
(Str)(Str src, ref immutable(ubyte)[] dst, string charsetName = null)
if(isSomeString!Str);
immutable(ubyte)[]encodeText
(Str)(Str src, string charsetName = null)
if(isSomeString!Str);
autoencodeText
(string charsetName, Args...)(auto ref Args args); - alias
toMBS
= encodeText(Src, Range)(Src src, auto ref Range dst, string charsetName = null) if (isSomeString!Src && isOutputRange!(Range, ubyte));