Skip to content

Bug: Unable to retrieve xls cell values using RSTRING records #655

@aquasync

Description

@aquasync

Current behavior

Currently running the sample code produces this output:

Got value from cell: None

Expected behavior

It should be able to read the cell value:

Got value from cell: Some(String("ELECTORAL DIVISION OF SOMERSET EAST ; FIELD-CÓRNËTCY No. 5, ZWAGERSHÓÊN."))

Sample code to reproduce

use calamine::{
    Error, Reader, Xls, open_workbook,
};

fn main() -> Result<(), Error> {
    let test_file = "biff5-rich-text-string.xls";
    let mut workbook: Xls<_> = open_workbook(test_file)?;
    let sheet_range = workbook.worksheet_range("Sheet1")?;
    println!("Got value from cell: {:?}", sheet_range.get_value((0, 0)));
    Ok(())
}

Test file

This file is from the test suite of the R readxl package. It displays fine in both LibreOffice & MS Excel.

biff5-rich-text-string.xls

It was apparently produced by ABBYY FineReader (OCR software).

Environment

- calamine version: 0.35
- Cargo.toml dependency line for calamine: calamine = "0.35.0"
- rustc version: rustc 1.94.0
- Excel/OpenOffice/LibreOffice version: 
- OS: windows/linux

Checklist

  • I have added a complete sample program that compiles in Rust.
  • I have added a test file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions