#include <tads.h>
#include <bytearr.h>

main(args)
{
    local b; 
    local latin1 = new CharacterSet('latin-1');

    b = new ByteArray('this is a test string: אבגדהו', 'us-ascii');
    "made array w/ char set 'us-ascii'\n";

    b = new ByteArray('this is a test string: אבגדהו', 'latin-1');
    "made array w/ char set 'latin-1'\n";

    b = new ByteArray('this is a test string: אבגדהו', latin1);
    "made array w/ char set latin1 obj\n";

    b = new ByteArray('this is a test string: ABC', 'latin-2');
    "made array w/ char set 'latin-2'\n";

	// crashes:
    b = new ByteArray('this is a test string: אבגדהו');
    "made array w/ default char set\n";
}
