Changeset 35


Ignore:
Timestamp:
Nov 25, 2021, 3:04:55 PM (3 years ago)
Author:
chronos
Message:
  • Added: Support for QUOTED-PRINTABLE encoding.
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r33 r35  
    1717    Top = 10
    1818    Width = 893
    19     ActivePage = TabSheetGeneral
     19    ActivePage = TabSheetAll
    2020    Anchors = [akTop, akLeft, akRight, akBottom]
    2121    ParentFont = False
    22     TabIndex = 0
     22    TabIndex = 2
    2323    TabOrder = 0
    2424    object TabSheetGeneral: TTabSheet
  • trunk/Forms/UFormContact.pas

    r33 r35  
    197197    Photo := Contact.Fields[cfPhoto];
    198198    if (Photo <> '') and (PhotoProperty.Encoding <> '') then begin
    199       Photo := PhotoProperty.GetDecodedValue;
    200199      Stream := TMemoryStream.Create;
    201200      try
  • trunk/Languages/vCardStudio.cs.po

    r34 r35  
    644644msgid "Modified"
    645645msgstr "Upraveno"
     646
     647#: uquotedprintable.slinelengtherr
     648msgid "Invalid line length for encoded text"
     649msgstr "Neplatná délka řádky kódovaného textu"
  • trunk/Languages/vCardStudio.po

    r34 r35  
    629629msgstr ""
    630630
     631#: uquotedprintable.slinelengtherr
     632msgid "Invalid line length for encoded text"
     633msgstr ""
     634
  • trunk/UContact.pas

    r34 r35  
    117117
    118118implementation
     119
     120uses
     121  UQuotedPrintable;
    119122
    120123resourcestring
     
    226229procedure TContactProperty.EvaluateAttributes;
    227230var
    228   Index: Integer;
     231  I: Integer;
    229232begin
    230233  if Attributes.IndexOf('BASE64') <> -1 then
    231234    Encoding := 'BASE64'
    232235  else
    233   if Attributes.IndexOfName('ENCODING') <> -1 then
    234     Encoding := Attributes.Values['ENCODING']
    235     else Encoding := '';
     236  if Attributes.IndexOfName('ENCODING') <> -1 then begin
     237    Encoding := Attributes.Values['ENCODING'];
     238    if (Encoding = 'QUOTED-PRINTABLE') or (Encoding = 'BASE64') then begin
     239      Values.DelimitedText := GetDecodedValue;
     240      Attributes.Delete(Attributes.IndexOfName('ENCODING'));
     241    end;
     242  end else Encoding := '';
    236243
    237244  if Attributes.IndexOfName('CHARSET') <> -1 then
     
    240247
    241248  // Simplify TYPE attribute from TYPE=VALUE into VALUE
    242   Index := Attributes.IndexOfName('TYPE');
    243   if Index <> -1 then
    244     Attributes.Strings[Index] := Attributes.Values['TYPE'];
     249  for I := 0 to Attributes.Count - 1 do begin
     250    if Attributes.Names[I] = 'TYPE' then
     251      Attributes.Strings[I] := Attributes.Values['TYPE'];
     252  end;
    245253end;
    246254
     
    251259  else
    252260  if Encoding = 'QUOTED-PRINTABLE' then
    253     Result := Values.DelimitedText
     261    Result := DecodeQuotedPrintable(Values.DelimitedText)
    254262  else Result := '';
    255263end;
  • trunk/vCardStudio.lpi

    r31 r35  
    101101      </Item2>
    102102    </RequiredPackages>
    103     <Units Count="11">
     103    <Units Count="12">
    104104      <Unit0>
    105105        <Filename Value="vCardStudio.lpr"/>
     
    170170        <ResourceBaseClass Value="Form"/>
    171171      </Unit10>
     172      <Unit11>
     173        <Filename Value="UQuotedPrintable.pas"/>
     174        <IsPartOfProject Value="True"/>
     175      </Unit11>
    172176    </Units>
    173177  </ProjectOptions>
  • trunk/vCardStudio.lpr

    r30 r35  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, Common, UDataFile, SysUtils, UFormContacts,
    11   UFormContact, UFormFindDuplicity, UFormGenerate, UFormError
     11  UFormContact, UFormFindDuplicity, UFormGenerate, UFormError, UQuotedPrintable
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.