// as2
function getByte(str:String):Number {
	var byte:Number = 0;
	var len:Number = str.length;
	for (var i:Number = 0; i < len; ++i) {
		var code:Number = str.charCodeAt(0);
		// check 2byte character
		if (code < 255) {
			byte = byte + 1;
		} else {
			byte = byte + 2;
		}

	}

	return byte;
}


var ts:String = "!~##$%^&*(()_+=-09876543421`가asdf";
trace(getByte(ts));