Fix #149 Query sharedstring control characters not encoding
This commit is contained in:
wei 2021-04-06 17:05:11 +08:00
parent 340793574d
commit b354b947f6
3 changed files with 24 additions and 1 deletions

View File

@ -2,6 +2,9 @@
## Release Notes
### 0.10.3
- [Bug] Fix Query SharedStrings control character not encoding (issue [Issue #149](https://github.com/shps951023/MiniExcel/issues/149))
### 0.10.2
- [Bug] Fix SharedStrings get wrong index (issue [#153](https://github.com/shps951023/MiniExcel/issues/153))
- [Bug] SaveAs support control character encoding (issue [Issue #149](https://github.com/shps951023/MiniExcel/issues/149))

View File

@ -19,7 +19,7 @@
<RepositoryUrl>https://github.com/shps951023/MiniExcel</RepositoryUrl>
<PackageIconUrl>https://raw.githubusercontent.com/shps951023/ImageHosting/master/img/2019-01-17.13.18.32-image.png</PackageIconUrl>
<TargetFrameworks>net461;netstandard2.0;net5.0</TargetFrameworks>
<Version>0.10.2</Version>
<Version>0.10.3</Version>
<PackageReleaseNotes>Please Check [Release Notes](https://github.com/shps951023/MiniExcel/tree/master/docs)</PackageReleaseNotes>
<RepositoryType>Github</RepositoryType>
</PropertyGroup>

View File

@ -56,6 +56,26 @@ namespace MiniExcelLibs.Tests
Assert.Equal(chars[i], rows[i]);
}
}
{
string path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.xlsx");
var input = chars.Select(s => new { Test = s.ToString() });
MiniExcel.SaveAs(path, input);
var rows = MiniExcel.Query<Issue149VO>(path).Select(s => (string)s.Test).ToList();
for (int i = 0; i < chars.Length; i++)
{
output.WriteLine($"{i} , {chars[i]} , {rows[i]}");
if (i == 13 || i == 9 || i == 10)
continue;
Assert.Equal(chars[i], rows[i]);
}
}
}
public class Issue149VO
{
public string Test { get; set; }
}
/// <summary>