handle/throw on invalid encoding for ucnv_open