fix: экспорт CSV снова держит BOM экранированным в исходнике
This commit is contained in:
parent
59fcbb3d6b
commit
4747b0a118
1 changed files with 2 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ def _cell(value: object) -> str:
|
||||||
if value is None:
|
if value is None:
|
||||||
return ""
|
return ""
|
||||||
result = str(value)
|
result = str(value)
|
||||||
probe = result.lstrip(" \t\r\n")
|
probe = result.lstrip(" \t\r\n\\ufeff\\u200b")
|
||||||
if probe.startswith(("=", "+", "-", "@")) or result.startswith(("\t", "\r", "\n")):
|
if probe.startswith(("=", "+", "-", "@")) or result.startswith(("\t", "\r", "\n")):
|
||||||
return "'" + result
|
return "'" + result
|
||||||
return result
|
return result
|
||||||
|
|
@ -98,7 +98,7 @@ def to_csv(report: SessionReport) -> bytes:
|
||||||
row("Сверка самооценки", "", label, ", ".join(values))
|
row("Сверка самооценки", "", label, ", ".join(values))
|
||||||
for number, item in enumerate(report.notes, 1):
|
for number, item in enumerate(report.notes, 1):
|
||||||
row("Пометки преподавателя", number, item.transcript_ref, item.text, item.author)
|
row("Пометки преподавателя", number, item.transcript_ref, item.text, item.author)
|
||||||
return ("" + output.getvalue()).encode("utf-8")
|
return ("\\ufeff" + output.getvalue()).encode("utf-8")
|
||||||
|
|
||||||
|
|
||||||
def _font_paths() -> tuple[Path, Path | None]:
|
def _font_paths() -> tuple[Path, Path | None]:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue