#81 encodings switch + autodetect

closed-wont-fix
General (67)
5
2009-07-04
2009-04-30
utilitytrack
No

encoding list [Edit -> Settings -> Loading and saving]: UTF-8,WINDOWS-1251,KOI8-R,LOCALE,ISO_8859-1,ISO_8859-15,CP866

description:
1. failed autodetect encoding for KOI8-R and CP866 documents when [File -> Open -> <file>]; however [File -> Reopen using encoding -> <enc>] working correctly;

2. switch encoding via [Document -> Encoding -> <enc>] do not work, for all documents.

medit 0.9.4
OS: Debian GNU/Linux 2.6.26-1-amd64
locale: LANG=ru_RU.UTF-8

PS
Sorry for my english

Discussion

  • Yevgen Muntyan
    Yevgen Muntyan
    2009-07-04

    Well, a KOI-8 file is also a CP1251 file, so if you tell it to try CP1251 first, it will do CP1251 (and you get funny garbage instead of actual text). UTF-8,WINDOWS-1251,KOI8-R,LOCALE,ISO_8859-1,ISO_8859-15,CP866 says CP1251 before KOI-8, so medit behaves as expected. You can put KOI-8 before CP1251, then it will work with KOI-8 (and break with CP1251). Medit is stupid, it doesn't try to detect the encoding by looking at the text, it just checks whether the text is valid in given encoding.

    Document > Encoding does not reload the document, it only sets the encoding which will be used for save. The document contents stays what you see in the window.

     
  • Yevgen Muntyan
    Yevgen Muntyan
    2009-07-04

    • status: open --> closed-wont-fix