Skip to content

Commit

Permalink
version bump 0.7.5: sheet name encoding
Browse files Browse the repository at this point in the history
- BIFF8 uses unicode BIFF5 uses codepage for sheet names (h/t @ajuhos @shakhal)
- Added readFileSync, readSync (h/t @jmarca)
  • Loading branch information
SheetJSDev committed Feb 18, 2015
1 parent b7be968 commit 8979999
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 30 deletions.
2 changes: 1 addition & 1 deletion bin/xls.njs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
/* xls.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
/* xls.js (C) 2013-2015 SheetJS -- http://sheetjs.com */
var n = "xls";
/* vim: set ts=2 ft=javascript: */
var X = require('../');
Expand Down
2 changes: 1 addition & 1 deletion bits/01_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
XLS.version = '0.7.4-a';
XLS.version = '0.7.5';
6 changes: 5 additions & 1 deletion bits/20_parsebits.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ function parse_Bes(blob) {
function parse_ShortXLUnicodeString(blob, length, opts) {
var cch = blob.read_shift(1);
var width = 1, encoding = 'sbcs';
var cp = current_codepage;
if(opts && opts.biff >= 8) current_codepage = 1200;
if(opts === undefined || opts.biff !== 5) {
var fHighByte = blob.read_shift(1);
if(fHighByte) { width = 2; encoding = 'dbcs'; }
}
return cch ? blob.read_shift(cch, encoding) : "";
var o = cch ? blob.read_shift(cch, encoding) : "";
current_codepage = cp;
return o;
}

/* 2.5.293 XLUnicodeRichExtendedString */
Expand Down
2 changes: 2 additions & 0 deletions bits/98_exports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
XLS.parse_xlscfb = parse_xlscfb;
XLS.read = xlsread;
XLS.readFile = readFile;
XLS.readSync = xlsread;
XLS.readFileSync = readFile;
XLS.utils = utils;
XLS.CFB = CFB;
XLS.SSF = SSF;
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "js-xls",
"homepage": "https://github.com/SheetJS/js-xls",
"main": "dist/xls.js",
"version": "0.7.4-a",
"version": "0.7.5",
"ignore": [
"bin",
"bits",
Expand Down
10 changes: 5 additions & 5 deletions dist/xls.core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xls.core.min.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/xls.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xls.full.min.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions dist/xls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*jshint funcscope:true, eqnull:true */
var XLS = {};
(function make_xls(XLS){
XLS.version = '0.7.4-a';
XLS.version = '0.7.5';
var current_codepage = 1200, current_cptable;
if(typeof module !== "undefined" && typeof require !== 'undefined') {
if(typeof cptable === 'undefined') cptable = require('./dist/cpexcel');
Expand Down Expand Up @@ -1777,11 +1777,15 @@ function parse_Bes(blob) {
function parse_ShortXLUnicodeString(blob, length, opts) {
var cch = blob.read_shift(1);
var width = 1, encoding = 'sbcs';
var cp = current_codepage;
if(opts && opts.biff >= 8) current_codepage = 1200;
if(opts === undefined || opts.biff !== 5) {
var fHighByte = blob.read_shift(1);
if(fHighByte) { width = 2; encoding = 'dbcs'; }
}
return cch ? blob.read_shift(cch, encoding) : "";
var o = cch ? blob.read_shift(cch, encoding) : "";
current_codepage = cp;
return o;
}

/* 2.5.293 XLUnicodeRichExtendedString */
Expand Down Expand Up @@ -7375,6 +7379,8 @@ var utils = {
XLS.parse_xlscfb = parse_xlscfb;
XLS.read = xlsread;
XLS.readFile = readFile;
XLS.readSync = xlsread;
XLS.readFileSync = readFile;
XLS.utils = utils;
XLS.CFB = CFB;
XLS.SSF = SSF;
Expand Down
10 changes: 5 additions & 5 deletions dist/xls.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xls.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<!-- xls.js (C) 2013-2014 SheetJS http://sheetjs.com -->
<!-- xls.js (C) 2013-2015 SheetJS http://sheetjs.com -->
<!-- vim: set ts=2: -->
<html>
<head>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xlsjs",
"version": "0.7.4-a",
"version": "0.7.5",
"author": "sheetjs",
"description": "Excel 5.0/95 and 97-2004 spreadsheet (BIFF5 XLS / BIFF8 XLS / XML 2003) parser",
"keywords": [ "excel", "xls", "office", "spreadsheet" ],
Expand Down
10 changes: 8 additions & 2 deletions xls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*jshint funcscope:true, eqnull:true */
var XLS = {};
(function make_xls(XLS){
XLS.version = '0.7.4-a';
XLS.version = '0.7.5';
var current_codepage = 1200, current_cptable;
if(typeof module !== "undefined" && typeof require !== 'undefined') {
if(typeof cptable === 'undefined') cptable = require('./dist/cpexcel');
Expand Down Expand Up @@ -1777,11 +1777,15 @@ function parse_Bes(blob) {
function parse_ShortXLUnicodeString(blob, length, opts) {
var cch = blob.read_shift(1);
var width = 1, encoding = 'sbcs';
var cp = current_codepage;
if(opts && opts.biff >= 8) current_codepage = 1200;
if(opts === undefined || opts.biff !== 5) {
var fHighByte = blob.read_shift(1);
if(fHighByte) { width = 2; encoding = 'dbcs'; }
}
return cch ? blob.read_shift(cch, encoding) : "";
var o = cch ? blob.read_shift(cch, encoding) : "";
current_codepage = cp;
return o;
}

/* 2.5.293 XLUnicodeRichExtendedString */
Expand Down Expand Up @@ -7375,6 +7379,8 @@ var utils = {
XLS.parse_xlscfb = parse_xlscfb;
XLS.read = xlsread;
XLS.readFile = readFile;
XLS.readSync = xlsread;
XLS.readFileSync = readFile;
XLS.utils = utils;
XLS.CFB = CFB;
XLS.SSF = SSF;
Expand Down
2 changes: 1 addition & 1 deletion xlsworker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* xls.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
/* xls.js (C) 2013-2015 SheetJS -- http://sheetjs.com */
/* uncomment the next line for encoding support */
//importScripts('dist/cpexcel.js');
importScripts('xls.js');
Expand Down
2 changes: 1 addition & 1 deletion xlsworker1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* xls.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
/* xls.js (C) 2013-2015 SheetJS -- http://sheetjs.com */
/* uncomment the next line for encoding support */
//importScripts('dist/cpexcel.js');
importScripts('xls.js');
Expand Down
2 changes: 1 addition & 1 deletion xlsworker2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* xls.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
/* xls.js (C) 2013-2015 SheetJS -- http://sheetjs.com */
/* uncomment the next line for encoding support */
//importScripts('dist/cpexcel.js');
importScripts('xls.js');
Expand Down

0 comments on commit 8979999

Please sign in to comment.