Skip to content

Collection of encodings for the D language.

License

Notifications You must be signed in to change notification settings

zhad3/zencoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zencoding

Collection of encodings for the D language. Right now it only has one encoding: Windows code page 949

It also can only decode. If needed an encoder might be added later.

Usage

dub.json

{
    ...
    "dependencies": {
        "zencoding:windows949": "~>1.0.0"
    },
    ...
}
int main(string[] args)
{
    import zencoding.windows949 : fromWindows949;

    const(ubyte)[] cp949 = [0xc0, 0xaf, 0xc0, 0xfa, 0xc0, 0xce, 0xc5, 0xcd,
                            0xc6, 0xe4, 0xc0, 0xcc, 0xbd, 0xba, 0x0a];

    wstring utf16 = fromWindows949(cp949);

    import std.stdio : writeln;
    writeln(utf16);

    return 0;
}

TODO

Use another algorithm instead of the huge look-up table.

About

Collection of encodings for the D language.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages