Sample code for 30+ languages & platforms
Ruby

Load utf-8 Text File into a StringBuilder

Demonstrates how to load a utf-8 text file into a StringBuilder object instance.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

sb = Chilkat::CkStringBuilder.new()

success = sb.LoadFile("someFileContainingUtf8.txt","utf-8")
if (success != true)
    print "Failed." + "\n";
else
    print "Success." + "\n";
end