You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Excel has upper limit of character count which is 32767, but excelize checks value length by bytes instead by characters.
If I put utf-8 value (repeated 17000 times two-bytes symbol "Ы", for example) to a cell, excelize won't show any error, but file will be corrupted. Excel will show error on this file. Mac Numbers doesn't show any error, but empty cell and half-empty file.
The worst is that without the fix you can not fix this from outside, because if len(value) > TotalCellChars is true for every utf-8 TotalCellChars/2 len string and next line value[:TotalCellChars] will corrupt the string because you must not slice strings in Go in this way.
Description
Excel has upper limit of character count which is 32767, but excelize checks value length by bytes instead by characters.
If I put utf-8 value (repeated 17000 times two-bytes symbol "Ы", for example) to a cell, excelize won't show any error, but file will be corrupted. Excel will show error on this file. Mac Numbers doesn't show any error, but empty cell and half-empty file.
I've already created pull request: #1517
Steps to reproduce the issue:
String
long_value
contains 17000 chars, but it will go intoif len(value) > TotalCellChars
because...Go works so. Let's fix it.Output of
go version
:go version go1.19.1 darwin/arm64
Excelize version or commit ID:
v2.7.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
It doesn't rely on an environment.
The text was updated successfully, but these errors were encountered: