Sample code for 30+ languages & platforms
Tcl

StringBuilder GetEncoded

Demonstrates the Chilkat StringBuilder GetEncoded method.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set s "The quick brown fox jumps over the lazy dog"

set sb [new_CkStringBuilder]

CkStringBuilder_Append $sb $s

# output: The quick brown fox jumps over the lazy dog
puts [CkStringBuilder_getAsString $sb]

# Get the string encoded to base64, without changing the contents of sb.
# output: VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==
puts [CkStringBuilder_getEncoded $sb base64 utf-8]

# The contents of sb are not changed..
# output: The quick brown fox jumps over the lazy dog
puts [CkStringBuilder_getAsString $sb]

delete_CkStringBuilder $sb