use set instead of array
fix #206. Add a test to check unicode support