Perl Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Utf-8 Source Files and Unicode::String

 Chilkat Perl Module Downloads for Windows, Linux, and MAC OS X

Basic information about using utf-8 Perl source files. This allows for string literals in any language to be used with Perl.


#The declaration "use utf8;" determines how the script source file containing it is 
#interpreted. If this declaration is used, strings within the source file will be 
#interpreted as being encoded in utf8.
use utf8;

# A Unicode::String object represents a sequence of Unicode characters. Methods are
# provided to convert between various external formats (encodings) and Unicode::String
# objects, and methods are provided for common string manipulations.
use Unicode::String qw(utf8 latin1 utf16);

$u = utf8("Is féidir liom gloinne a ithe. Ní dhéanann sí dochar ar bith dom.");

# If you run this script from an MS-DOS prompt, redirect the output to a file
# because the DOS console will not display the 8bit characters correctly...
# Even though the Perl source file is utf-8, we can emit in any character encoding.
print "Latin1: ", $u->latin1, "\n";

# Commented out code to emit in other encodings...
#print "UCS-4: ",  $u->ucs4,   "\n"; # 4 byte characters
#print "UTF-16: ", $u->utf16,  "\n"; # 2 byte characters + surrogates
#print "UTF-8: ",  $u->utf8,   "\n"; # 1-4 byte characters
#print "UTF-7: ",  $u->utf7,   "\n"; # 7-bit clean format
#print "Hex: ",    $u->hex,    "\n"; # a hexadecimal string


 

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