Add unit tests for encoding aware 

Just add units for pull request #20 already merged