View Issue Details

IDProjectCategoryView StatusLast Update
0035320LazarusIDEpublic2019-05-15 11:56
ReporterRalph FriedrichAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformX86_64OSWindowsOS VersionWindows 7
Product Version2.0Product BuildSVN 60307 
Target VersionFixed in Version 
Summary0035320: Character encodings are always read from inputhistory.xml. Changes in file like BOM UTF-8 are ignored.
DescriptionWhen you change a encoding in Lazarus editor it is stored in inputhistory.xml.
Changing encoding outside of Lazarus is ignored.


Steps To ReproduceChange a encoding in Lazarus editor of a pas file to CP1252.
Close Lazarus.
Change the encoding with notepad BOM UTF-8.
Reopen the file with Lazarus shows the bom mark cryptic and the old encoding from inputhistory.xml.
Clear <FileEncodings Count="0"> and the file is correct loaded.
Additional InformationAnother problem is.
The difference between displayed "ANSI(CP1252)" and "CP1252" comes only from inputhistory.xml.
This is for the user not transparent.
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetWin32/Win64
Attached Files

Activities

Mattias Gaertner

2019-04-04 11:33

manager   ~0115223

Last edited: 2019-04-04 11:35

View 2 revisions

By default Lazarus tries to guess the encoding (e.g. UTF8 or Windows system codepage).
If you change the encoding in the IDE, you override the automatism.

Mattias Gaertner

2019-04-04 11:41

manager   ~0115224

In case an override is set and the file has an UTF8-BOM it would be nice if the IDE would ask.

nanobit

2019-05-15 11:56

reporter   ~0116205

This might be related: *.lfm utf8 BOM (3 bytes) is always lost after form save.

If this utf8 BOM was created via menu (thus registered in inputhistory.xml),
then after form-save (BOM loss), the next form load will fail with:
"Format error: Unable to convert text form data of file "unit1.lfm"
Reason: The form loader sees only the last three chars "ect" instead of "object"

Issue History

Date Modified Username Field Change
2019-04-04 11:06 Ralph Friedrich New Issue
2019-04-04 11:33 Mattias Gaertner Note Added: 0115223
2019-04-04 11:35 Mattias Gaertner Note Edited: 0115223 View Revisions
2019-04-04 11:41 Mattias Gaertner Note Added: 0115224
2019-05-15 11:56 nanobit Note Added: 0116205