national-encoding 1.0.0

Support for onebyte nation encodings


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

national charsets support

Key features

  • Rangify charset functions
  • Support more than 100 national one byte code pages

Sample

import national.encoding;
unittest
{
	import std.array;
	dstring s = "123Я";
	auto cp1251 = Windows1251.encode(s).array;
	assert(cp1251[$-1]==223);
	auto utf32 = Windows1251.decode(cp1251).array;
	assert(utf32[$-1]=='Я');

	ubyte[] cp866 = CHARSETS["cp866"].encode(s).array;
	assert(cp866[$-1]==159);
	utf32 = CHARSETS["cp866"].decode(cp866).array;
	assert(utf32[$-1]=='Я');
}

Authors: Nikolay Tolstokulakov

Dependencies: none

Versions:
1.0.0 2015-Oct-28
~master 2015-Nov-12
Show all 2 versions
Stats:
  • 0 downloads today

  • 0 downloads this week

  • 9 downloads this month

  • 243 downloads total