Java
Java
Load utf-8 Text File into a StringBuilder
Demonstrates how to load a utf-8 text file into a StringBuilder object instance.Chilkat Java Downloads
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
boolean success = false;
CkStringBuilder sb = new CkStringBuilder();
success = sb.LoadFile("someFileContainingUtf8.txt","utf-8");
if (success != true) {
System.out.println("Failed.");
}
else {
System.out.println("Success.");
}
}
}