|
From: Petr P. <Pri...@sk...> - 2007-01-31 09:54:27
|
Dalibor Petri=E8evi=E6 > Petr Prikryl wrote: > > [...] > > I can explain the encoding to jEdit by adding > > explicitly another similar line; so, I can use > > [...] > > # :encoding=3Dwindows-1250: >=20 > Pardon my question but are you shure that=20 > :encoding=3Dwindows-1250: causes Jedit to set proper=20 > encoding when opening file? One can never be sure ;-). Double checking is always better. It seems that you found the bug. I have created the file a.txt like this ---------------------------------------- :encoding=3Dwindows-1250: P=F8=ED=B9ern=EC =BElu=BBou=E8k=FD k=F9=F2 =FAp=ECl =EF=E1belsk=E9 =F3dy (i.e. The quick brown fox.... for the Czech=20 language using the encoding.) ---------------------------------------- in another editor. Then I switched jEdit to use utf-8 as default encoding (this is important to show the bug) and exited jEdit (not running=20 in background, invisible mode). If I start jEdit and pass the file through the command line argument, it loads the file and displays the content in the prescribed=20 encoding correctly. However, when I open the file using Ctrl+O,=20 the prescribed encoding is ignored and the=20 content is displayed asuming the default jEdit encoding (here utf-8).=20 When I do File - Reload from the menu, it=20 is then reloaded and displayed correctly. It seems that the File - Open implementation forgot to interpret the explicit encoding prescription before displaying the content. > This is something that I wished for years > but experience shows that this is not actually=20 > working. I THINK the process goes this way:=20 > Jedit first opens file and then parses it.=20 > THEN Jedit can determine encoding specified=20 > as you are doing it and then it should reopen it=20 > with propper encoding and (re)show chars in=20 > proper encoding. It does not do that as=20 > far as I can see. You actually have to specify=20 > manually file encoding BEFORE opening file.=20 > This is how stuff works now. As far as I can say, the Dalibor's observation is true. I did not noticed the bug until now, because I use the FAR manager and usually open the file in jEdit by pointing to the file and=20 using Ctrl+F4 shortcut. It means that I pass the file to jEdit through command line and it works correctly even if jEdit is already=20 running. Also, normally I have the default encoding of jEdit set to windows-1250, so the bug=20 is masked. Could someone else confirm the bug? Would it be difficult to correct the bug? I am using jEdit 4.3pre9 with Java 1.5.0_10 with options -background -nogui -reuseview Thanks, pepr |