Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

Change file Encode codepage?

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zaher Dirkey

Hi,

I want to change the file codepage, i do it inside the IDE: "File Setting"->"Encoding"-> "UTF8 with BOM"
We have dialog asked (Change File) (Reopen with another encode),

1 - What the different between that options?.
2 - When (Reopen with another encode) it is add strange chars in the first line of the file, is that bug?.

I used last svn Lazarus 0.9.31 with FPC 2.4.4

Thanks in Advance
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110818/4f902db5/attachment.html>

Reply by email

Mattias Gaertner
to Zaher Dirkey
Show quoted text 7 lines
Hi, I want to change the file codepage, i do it inside the IDE: "File Setting"->"Encoding"-> "UTF8 with BOM" We have dialog asked (Change File) (Reopen with another encode), 1 - What the different between that options?.

When the IDE opens a file it tries to guess what encoding it is. It then converts the file in memory to UTF-8.
If you think the IDE guessed right and you
want to convert the file to another encoding, use "Change File". If you think the IDE guessed wrong and it should open it with another encoding use the "Reopen".

2 - When (Reopen with another encode) it is add strange chars in the first line of the file, is that bug?.

That's pretty normal if you open a file and use the wrong encoding to convert it to UTF-8.

I used last svn Lazarus 0.9.31 with FPC 2.4.4

Mattias

Reply by email

Zaher Dirkey
to Mattias Gaertner

On Thu, Aug 18, 2011 at 8:19 PM, Mattias Gaertner <

Show quoted text 17 lines
wrote: When the IDE opens a file it tries to guess what encoding it is. It then converts the file in memory to UTF-8. If you think the IDE guessed right and you want to convert the file to another encoding, use "Change File". If you think the IDE guessed wrong and it should open it with another encoding use the "Reopen". > 2 - When (Reopen with another encode) it is add strange chars in the first > line of the file, is that bug?. That's pretty normal if you open a file and use the wrong encoding to convert it to UTF-8.

Ah i see that is normal now.
But still there is problem when open the file have UTF8 with BOM, not when use change the Encode, just normal open the file, it is add space(strange char) at the first char + first line, in Hex view of file there is the correct 3 BOM bytes, it is happned when i opened the file in Delphi UTF8+BOM and then open it in Lazarus.
Would some one test it also before submit a bug(or search for it :) ).

I used Windows XP.

Thanks

Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110818/ee790ea6/attachment-0001.html>

Reply by email

Zaher Dirkey
to Zaher Dirkey
Zaher Dirkey wrote 30 lines
On Thu, Aug 18, 2011 at 8:19 PM, Mattias Gaertner < > wrote: > When the IDE opens a file it tries to guess what encoding it is. It > then converts the file in memory to UTF-8. > If you think the IDE guessed right and you > want to convert the file to another encoding, use "Change File". > If you think the IDE guessed wrong and it should open it with another > encoding use the "Reopen". > > > > 2 - When (Reopen with another encode) it is add strange chars in the > first > > line of the file, is that bug?. > > That's pretty normal if you open a file and use the wrong encoding > to convert it to UTF-8. > Ah i see that is normal now. But still there is problem when open the file have UTF8 with BOM, not when use change the Encode, just normal open the file, it is add space(strange char) at the first char + first line, in Hex view of file there is the correct 3 BOM bytes, it is happned when i opened the file in Delphi UTF8+BOM and then open it in Lazarus. Would some one test it also before submit a bug(or search for it :) ).

The probelm it happend when choose the file witout BOM, close it, open it outside Lazarus IDE, change the format to With BOM, lazarus remember file ecnodeing that choose for the file, the file opened now as Without BOM but bom bytes now loaded to the SynEdit.

I think Lazarus must check the BOM bytes even if choosed another format.

Thanks

Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110819/4d39dcf4/attachment.html>

Reply by email