return string.substring(range[0], range[1]);
};
+var Unicode = function(string) {
+ this.string = string;
+ this.length = length(string);
+};
+
+Unicode.prototype.charAt = function(index) {
+ return new Unicode(charAt(this.string, index));
+};
+
+Unicode.prototype.substr = function(start, length) {
+ return new Unicode(substr(this.string, start, length));
+};
+
+Unicode.prototype.substring = function(start, end) {
+ return new Unicode(substring(this.string, start, end));
+};
+
+Unicode.prototype.toString = function() {
+ return this.string;
+};
+
return {
decode: decode,
encode: encode,
length: length,
substr: substr,
substring: substring,
+
+ Unicode: Unicode,
};
});