objective c - How to detect characters with unknown encoding (like Textmate)? -


textmate not allow open file characters in unknown encoding. example, when wrong encoding selected, open button disabled:

enter image description here

when proper encoding selected, open button enabled:

enter image description here

is there c or objective-c library reporting characters encoded outside current encoding?

the usual approach load text assuming default encoding (like utf-8/16 or latin 1). if there's bom @ start of text indication text form of unicode. bom helps find transformation format used (utf-8 etc.).

if loading text still fails it's time ask user hint (charset selection), because it's difficult guess used encoding is.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -