Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Xojo Plugin Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Geolocation
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text

HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Xojo Plugin) Convert a File from utf-8 to ANSI (such as Windows-1252)

This example is to satisfy a particular user's support question:

I have a file that contains this text:
Original file textConverted using notepad
TextCAFÉCAFÉ
Hex43 41 46 c3 8943 41 46 c9

The utf-8 representation of the character É is the two bytes 0xC3 0x89. When Notepad is displaying the utf-8 file, it is intepreting the bytes as if they are ANSI (1 byte per char), and thus it is showing the ANSI char for 0xC3 (Ã) and the ANSI char for 0x89 (‰). After converting to ANSI, the É is represented by the single byte 0xC9.

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

Dim charset As New Chilkat.Charset

charset.FromCharset = "utf-8"
charset.ToCharset = "ANSI"

// We could alternatively be more specific and say "Windows-1252".
// The term "ANSI" means -- whatever character encoding is defined as the ANSI
// encoding for the computer.  In Poland, for example, it would be the single-byte-per-char
// used to represnt Eastern European language chars, which is Windows-1250.
charset.ToCharset = "Windows-1252"

Dim success As Boolean
success = charset.ConvertFile("qa_data/txt/cafeUtf8.txt","qa_output/cafeAnsi.txt")
If (success <> True) Then
    System.DebugLog(charset.LastErrorText)
    Return
End If

System.DebugLog("Success.")

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.