Bug 54907

Summary: Unreadable content error when reading .xlsx with external links containing U+3000('IDEOGRAPHIC SPACE') character.
Product: POI Reporter: Lee <hongzune>
Component: XSSFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: normal CC: dominik.stadler
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: The attached excel file for these issue has a external links
The file which produces Unreadable content error

Description Lee 2013-04-30 06:53:33 UTC
Created attachment 30241 [details]
The attached excel file for these issue has a external links

Just as simple test, I used POI to read the xlsx file and then immediately write it out without any modification.  
After writing with POI the xlsx file is unreadable by MS Excel 2010: 
Excel found unreadable content in 'xxx.xlsx'. Do you want to recover the contents of this workbook?

This is most likely happening because that the external links in workbook contain U+3000 "IDEOGRAPHIC SPACE" character (commonly called a 'full-width space').

※ how to create external links in excel
 Define a name by using the New Name dialog box
 1.On the Formulas tab, in the Defined Names group, click Define Name.
 2.In the New Name dialog box, in the Name box, type the name.
 3.To specify the scope of the name, select Workbook.
 4.In the Refers to box, type the cell reference of External Excel file.
   ex)='D:\[1 test.xlsx]Sheet1'!$A$2

This is the code I used: 

import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public class ExternalLinkTest {

	public static void main(String[] args) {

		Workbook workBook = null;
		try {
			workBook = WorkbookFactory
			    .create(new FileInputStream("externalLink.xlsx"));

			FileOutputStream fileOut;
			fileOut = new FileOutputStream("output_externalLink.xlsx");
		} catch (Exception e) {
Comment 1 Lee 2013-04-30 06:55:11 UTC
Created attachment 30242 [details]
The file which produces Unreadable content error
Comment 2 Dominik Stadler 2013-05-25 14:52:57 UTC
POI itself can read the file back in, however in the .xlsx file that is generated by POI, the file under /xl/externalLinks/_rels/externalLink1.xml.rels is missing completely in the resulting file.