-
-// voir : http://homepage3.nifty.com/aokura/jscript/utf8.html
-// et : http://www1.tip.nl/~t876506/utf8tbl.html
-Util.prototype.to_utf8 = function(s)
-{\r
- if (!s) return ""\r
-
- var c, d = ""
- for (var i = 0; i < s.length; i++)
- {
- c = s.charCodeAt(i);
- if (c <= 0x7f) {
- d += s.charAt(i);
- } else if (c >= 0x80 && c <= 0x7ff) {
- d += String.fromCharCode(((c >> 6) & 0x1f) | 0xc0);
- d += String.fromCharCode((c & 0x3f) | 0x80);
- } else {
- d += String.fromCharCode((c >> 12) | 0xe0);
- d += String.fromCharCode(((c >> 6) & 0x3f) | 0x80);
- d += String.fromCharCode((c & 0x3f) | 0x80);
- }
- }
- return d;
-}\r