You've already forked lazarus-ccr
TvPlanIt: Guess encoding of imported ical files and convert to utf8 if needed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9091 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -5,7 +5,8 @@ unit VpICAL;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, VpBaseDataFiles;
|
Classes, SysUtils, LConvEncoding,
|
||||||
|
VpBaseDataFiles;
|
||||||
|
|
||||||
type
|
type
|
||||||
TVpICalendar = class;
|
TVpICalendar = class;
|
||||||
@ -194,7 +195,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
VpConst, VpMisc, VpBase;
|
VpConst, VpBase;
|
||||||
|
|
||||||
const
|
const
|
||||||
DATE_FORMAT = 'yyyymmdd';
|
DATE_FORMAT = 'yyyymmdd';
|
||||||
@ -1010,6 +1011,7 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
currEntry: TVpICalEntry = nil;
|
currEntry: TVpICalEntry = nil;
|
||||||
oldEntry: TVpICalEntry = nil;
|
oldEntry: TVpICalEntry = nil;
|
||||||
|
enc: String;
|
||||||
begin
|
begin
|
||||||
// Clear item list
|
// Clear item list
|
||||||
Clear;
|
Clear;
|
||||||
@ -1019,6 +1021,8 @@ begin
|
|||||||
s := AStrings[i];
|
s := AStrings[i];
|
||||||
if s = '' then
|
if s = '' then
|
||||||
continue;
|
continue;
|
||||||
|
enc := GuessEncoding(s);
|
||||||
|
s := ConvertEncoding(s, enc, encodingUTF8);
|
||||||
p := pos(':', s);
|
p := pos(':', s);
|
||||||
if p = 0 then
|
if p = 0 then
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user