View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038372 | FPC | FCL | public | 2021-01-19 12:07 | 2021-01-20 10:22 |
Reporter | Yuriy Kopnin | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Product Version | 3.2.0 | ||||
Summary | 0038372: TStrings.SaveToStream | ||||
Description | Hello. When switching to FPC 3.2 and Lazarus 2.0.10, all TStrings.SaveToStream(S: TSTream) do not work. Procedure TStrings.SaveToStream(Stream: TStream); begin SaveToStream(Stream,False); end; then not works. If you fix: Procedure TStrings.SaveToStream(Stream: TStream); begin SaveToStream(Stream,True); end; then works. Same with LoadFromFile, LoadFromStream | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
It works fine here. {$mode objfpc} uses classes; Var F : TFileStream; begin F:=nil; With TStringList.Create do try Add('a'); Add('b'); F:=TFileStream.Create('a.txt',fmCreate); SaveToStream(F); Finally Free; F.Free; end; end. Creates a correct file. Please create a sample program that demonstrates the issue, and explain what you expect to see. |
|
I tried to create a test application, everything works in it. In older projects, Tstrings.SaveToStream (S: TStream) issues Access Violation, while there are no errors at the gas station 3.0.4. The error disappears if I explicitly specify DefaultEncoding: var SL: TSTringList; begin SL := TSTringList.Create; try SL.DefaultEncoding := SL.Encoding.UTF8; //SL.DefaultEncoding = nil !!!!!!!!! SL.SaveToStream(MyStream); //if you specify DefaultEncoding there are no errors finally SL.Free; end; end; For some reason, here SL.DefaultEncoding = nil |
|
I solved the problem, the error disappeared, the topic can be closed. |
|
Closing as per reporter's request |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-19 12:07 | Yuriy Kopnin | New Issue | |
2021-01-19 12:58 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2021-01-19 12:58 | Michael Van Canneyt | Status | new => assigned |
2021-01-19 13:02 | Michael Van Canneyt | Status | assigned => feedback |
2021-01-19 13:02 | Michael Van Canneyt | FPCTarget | => - |
2021-01-19 13:02 | Michael Van Canneyt | Note Added: 0128407 | |
2021-01-20 07:20 | Yuriy Kopnin | Note Added: 0128444 | |
2021-01-20 07:20 | Yuriy Kopnin | Status | feedback => assigned |
2021-01-20 07:21 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 07:21 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 07:28 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 07:30 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 07:30 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 07:31 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 08:09 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 08:13 | Yuriy Kopnin | Note Edited: 0128444 | View Revisions |
2021-01-20 10:17 | Yuriy Kopnin | Note Added: 0128445 | |
2021-01-20 10:22 | Michael Van Canneyt | Status | assigned => resolved |
2021-01-20 10:22 | Michael Van Canneyt | Resolution | open => unable to reproduce |
2021-01-20 10:22 | Michael Van Canneyt | Note Added: 0128447 |