forked from sheetjs/sheetjs
		
	- read and write support for Flat ODS files - read support for Uniform Office Spreadsheet (UOS) - IE6-8 cell regex split fix (fixes #350 #140 #268 h/t @Aymkdn @C0d3ine) - replace substr negative index with slices (fixes #351 h/t @Aymkdn) - ODS parsexmltag ignores ext overrides (fixes #548 h/t @lgodard) - csv can be written using write/writeFile with csv type - added `type` to README (fixes #432 h/t @tomkel)
		
			
				
	
	
		
			21 lines
		
	
	
		
			819 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			819 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var parse_text_p = function(text, tag) {
 | |
| 	return unescapexml(text.replace(/<text:s\/>/g," ").replace(/<[^>]*>/g,""));
 | |
| };
 | |
| 
 | |
| var utf8read = function utf8reada(orig) {
 | |
| 	var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;
 | |
| 	while (i < orig.length) {
 | |
| 		c = orig.charCodeAt(i++);
 | |
| 		if (c < 128) { out += String.fromCharCode(c); continue; }
 | |
| 		d = orig.charCodeAt(i++);
 | |
| 		if (c>191 && c<224) { out += String.fromCharCode(((c & 31) << 6) | (d & 63)); continue; }
 | |
| 		e = orig.charCodeAt(i++);
 | |
| 		if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }
 | |
| 		f = orig.charCodeAt(i++);
 | |
| 		w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;
 | |
| 		out += String.fromCharCode(0xD800 + ((w>>>10)&1023));
 | |
| 		out += String.fromCharCode(0xDC00 + (w&1023));
 | |
| 	}
 | |
| 	return out;
 | |
| };
 |