- if (index == 0)
- return "Use font encoding";
- charset = charset_localenc_nth(index-1);
- if (charset == CS_NONE)
+ charset = charset_localenc_nth(index);
+ if (charset == CS_NONE) {
+ /* "Use font encoding" comes after all the named charsets */
+ if (charset_localenc_nth(index-1) != CS_NONE)
+ return "Use font encoding";