* rewrite of charset logic
* start of unit tests