read/write ngrams in utf8