#303 auto detect file encoding when open file not work for me

open
nobody
General (289)
5
2009-04-28
2009-04-28
Garbin
No

version:0.16
os:ubuntu

desc:I have a file its encoding is "gbk", it copy from my windows system. I open it use geany 0.16 with auto detect file encoding, but the chinese in the file display incorrectly, and the encoding geany detected is 'ISO-8859-1', so i can't edit my windows text file well.

Discussion

  • Garbin

    Garbin - 2009-04-28

    the screenshot, the file is a "GBK" encoding file, but geany detected is iso-8859-1

     
  • Enrico Tröger

    Enrico Tröger - 2009-04-28

    Auto-detection of encodings doesn't work always accurately. The thing is, Geany probes all known encodings with the loading file and the first encoding which doesn't produce errors at converting will be used. This isn't very smart and not very efficient but it works mostly. The problem is, there is not really a good way to detect an encoding, so trying is the best one at the moment.

    It's only the auto-detection which fails, right? If you opened the file, try 'Reload As' from the File menu and choose the gbk encoding. If the contents are displayed correctly, it's only the auto-detection.
    If it happens with files you work often with, you could add a hint for Geany to use the right encoding. For details read http://geany.org/manual/#in-file-encoding-specification .

     
  • Garbin

    Garbin - 2009-04-29

    I tried it, and it works well for me. I don't know why other like gedit works well and geany can not. I use geany started from 0.13, it's the first and my favorite text editor on linux. This problem existed from 0.13, I tried it when new version came out. but ..... I like geany, I hope it will be better. thank you for your good job

     
  • Enrico Tröger

    Enrico Tröger - 2009-04-29

    Could you attach the file to this bugreport or in case it is something you can't share in public, send it to me per PM? I'd like to have a look because if Gedit detects it, Geany should do as well, in theory.

     
  • Garbin

    Garbin - 2009-04-30
     
  • Garbin

    Garbin - 2009-04-30

    it's OK,I'm sure gedit works well, the file "url_rewrite.txt" is copied from my windows system, the file encoding is "GBK". Because "GBK" is not in gedit's auto-detected list normally,so you will add "GBK" into the list by gconf-editor in order to open "GBK" file correctly. it is different from geany's encoding setting.

     

Log in to post a comment.