EPPlus icon indicating copy to clipboard operation
EPPlus copied to clipboard

Some japanese texts are not handled correctly when reading OfficeOpenXml file

Open PsykerUdot opened this issue 2 years ago • 1 comments

The library method ExcelRange.GetValue() returns null for the following text. This is the representation of text in sharedStrings.xml within xlsx file archive:

	<si>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Calibri"/>
				<family val="0"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">{0}</t>
		</r>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Microsoft YaHei"/>
				<family val="2"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">へのパスを入手できません。</t>
		</r>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Calibri"/>
				<family val="0"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">{0}</t>
		</r>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Microsoft YaHei"/>
				<family val="2"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">を実行し、</t>
		</r>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Calibri"/>
				<family val="0"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">Revizto</t>
		</r>
		<r>
			<rPr>
				<sz val="11"/>
				<color rgb="FF000000"/>
				<rFont val="Microsoft YaHei"/>
				<family val="2"/>
				<charset val="1"/>
			</rPr>
			<t xml:space="preserve">プラグインを初期化してください。解決しない場合は、一度予定を取り消し、再度タスクを予定してください。</t>
		</r>
	</si>

There are actually other japanese texts for which ExcelRange.GetValue() returns null.

EPPlus Version is 6.0.5.

PsykerUdot avatar Jun 21 '22 11:06 PsykerUdot

Adding your xml to the SharedString.xml for A1 and running the test below, works when I try it...

            using(var p = OpenTemplatePackage("I669.xlsx"))
            {
                var ws = p.Workbook.Worksheets[0];
                var v=ws.Cells["A1"].GetValue<string>();
                Assert.AreEqual("{0}へのパスを入手できません。{0}を実行し、Reviztoプラグインを初期化してください。解決しない場合は、一度予定を取り消し、再度タスクを予定してください。", v);
            }

Can you provide a fully reproducible sample with code and a workbook?

JanKallman avatar Jun 22 '22 08:06 JanKallman

I'll close this issue. Feel free to re-open it if you can provide a reproducible sample .

JanKallman avatar Aug 31 '22 07:08 JanKallman