Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) MIME Header Q and B Encoding and DecodingDemonstrates how to Q and B encode/decode.
Use ChilkatAx-win32.pkg Procedure Test Handle hoSb Boolean iSuccess 2 Handle hoSb2 String sTemp1 Get Create (RefClass(cComChilkatStringBuilder)) To hoSb If (Not(IsComObjectCreated(hoSb))) Begin Send CreateComObject of hoSb End Get ComAppend Of hoSb "This is a test" To iSuccess Get ComGetEncoded Of hoSb "B" "utf-8" To sTemp1 Showln sTemp1 // output is: // =?utf-8?B?VGhpcyBpcyBhIHRlc3Q=?= Get ComGetEncoded Of hoSb "Q" "iso-8859-1" To sTemp1 Showln sTemp1 // output is: // =?utf-8?Q?This_is_a_test?= Get Create (RefClass(cComChilkatStringBuilder)) To hoSb2 If (Not(IsComObjectCreated(hoSb2))) Begin Send CreateComObject of hoSb2 End Get ComAppend Of hoSb2 "=?utf-8?B?VGhpcyBpcyBhIHRlc3Q=?=" To iSuccess Get ComDecode Of hoSb2 "B" "utf-8" To iSuccess Get ComGetAsString Of hoSb2 To sTemp1 Showln sTemp1 // output is: // This is a test Send ComClear To hoSb2 Get ComAppend Of hoSb2 "=?utf-8?Q?This_is_a_test?=" To iSuccess Get ComDecode Of hoSb2 "Q" "utf-8" To iSuccess Get ComGetAsString Of hoSb2 To sTemp1 Showln sTemp1 // output is: // This is a test // "B" or "Q" will decode both B and Q. Send ComClear To hoSb2 Get ComAppend Of hoSb2 "=?utf-8?Q?This_is_a_test?= 123 =?utf-8?B?VGhpcyBpcyBhIHRlc3Q=?=" To iSuccess Get ComDecode Of hoSb2 "Q" "utf-8" To iSuccess Get ComGetAsString Of hoSb2 To sTemp1 Showln sTemp1 // output is: // This is a test 123 This is a test End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.