stringex 0.1.0

Port of Ruby stringex gem to D.


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

dub.json
dub.sdl

stringex-d

Partial port of Ruby's stringex into D. Right now it only includes unicode characters replacement via maps provided in YAML files.

Usage

The simplest way to use it is to simply call a unidecode function on a string:

import std.stdio;
import stringex.unidecode;

void main()
{
	writeln("ŻÓŁW".unidecode()); // => "ZOLW"
	writeln("影响".unidecode()); // => "Ying Xiang"
}

In the past there was a UniDecoder class used to cache YAML files used for decoding. However since version 0.1 it's no longer needed and it's left only for backwards compatibility, aliasing unidecode().

auto decoder = new UniDecoder();
auto decoded = decoder.decode("żółć"); // => "zolc"

What for?

This would probably be mostly useful for web apps and creating URLs for resources with unicode names. Another example is saving files with sane names.

License

Released under MIT license.

Authors:
Paweł Świątkowski, Sönke Ludwig
Dependencies:
none
Versions:
0.1.0 2017-Jul-24
0.0.3 2016-Nov-29
0.0.2 2015-Oct-22
0.0.1 2015-Jun-13
~master 2017-Jul-24
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 3 downloads this month

  • 445 downloads total