[Lazarus] File encoding changing silently
Hi, I am fighting with an ansi/unicode/utf8 problem and during this war observed a strange thing for me about file encoding. When a new project created the encoding is CP1250 (from File Setting/Encoding ) for me. Then saved the project the encoding is CP1250 in File Setting/Encoding. But when reopen the project (with or without close Lazarus) Encoding displays UTF8. Is it normal? Lazarus convert encoding automatically or new files created with UTF8 but File Setting/Encoding display wrong value? Gabor ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File encoding changing silently
Zitat von Gabor Boros gaborbo...@yahoo.com: Hi, I am fighting with an ansi/unicode/utf8 problem and during this war observed a strange thing for me about file encoding. When a new project created the encoding is CP1250 (from File Setting/Encoding ) for me. That's wrong. It should be UTF-8. (Unless you are using some other templates.) I fixed one place in r18166. Please test. Then saved the project the encoding is CP1250 in File Setting/Encoding. But when reopen the project (with or without close Lazarus) Encoding displays UTF8. Is it normal? Lazarus convert encoding automatically or new files created with UTF8 but File Setting/Encoding display wrong value? The IDE guesses the encoding on loading. Normal pascal units contain only ASCII characters, where CP1250 and UTF-8 are the same. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File encoding changing silently
I discovered next things. Created new project and encoding is UTF8. It is good. But set encoding to CP1250 and go into File Settings/Encoding no check appears before any item. But this problem showed only once. Second problem. The files created with UTF8 now. Right. But if set Encoding to CP1250 (after pressed Change file) File Settings/Encoding displays good CP1250 value but if reopen the project the File Settings/Encoding displays UTF-8 again. Gabor Mattias Gärtner írta: Zitat von Gabor Boros gaborbo...@yahoo.com: I fixed one place in r18166. Please test. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File encoding changing silently
Zitat von Gabor Boros gaborbo...@yahoo.com: I discovered next things. Created new project and encoding is UTF8. It is good. But set encoding to CP1250 and go into File Settings/Encoding no check appears before any item. Are you sure? Is there a menu item with a bracket? But this problem showed only once. Second problem. The files created with UTF8 now. Right. But if set Encoding to CP1250 (after pressed Change file) File Settings/Encoding displays good CP1250 value but if reopen the project the File Settings/Encoding displays UTF-8 again. Are there any CP1250 characters in the file? The IDE does not save the information about the encoding. It only saves the text in the encoding. If the file contains only ASCII characters, then setting CP1250 as encoding has no effect. You can add {%encoding CP1250} as the first line. BTW, why do you want to use CP1250 as encoding instead of UTF-8? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File encoding changing silently
Mattias Gärtner írta: Zitat von Gabor Boros gaborbo...@yahoo.com: Are you sure? Is there a menu item with a bracket? No. ;-) Before, I said CP1250 but now I say Ansi(cp1250). When click on Ansi(cp1250) and after go to Encoding again, Ansi(cp1250) and no other encoding selected. BTW, why do you want to use CP1250 as encoding instead of UTF-8? I don't want. Just playing with encoding setting after you fixed the problem. Gabor ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus