Set internal encoding