Skip to content

Commit

Permalink
Fixed excel compatability issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldo committed Nov 16, 2024
1 parent 948e92d commit b756511
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BackEndFlask/Functions/exportCsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def return_csv_str(self) -> str:
"""

# Writting a common identifying data.
self._writer.writerow(['\ufeff']) # A dom that helps excel auto use utf-8. Downside is that it uses up a line.
self._writer.writerow(["Course Name"])
self._writer.writerow([get_course_name_by_at_id(self._at_id)])
self._writer.writerow([' '])
Expand Down Expand Up @@ -192,7 +193,7 @@ def __init__(self, at_id: int) -> None:
at_id: <class 'int'>
"""
super().__init__(at_id)
self.__checkmark = "✔"
self.__checkmark = '\u2713'
self.__crossmark = " "

def _format(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ViewAssessmentTasks extends Component {
if(this.state.isLoaded && this.state.csvCreation) {
const fileData = this.state.csvCreation["csv_data"];

const blob = new Blob([fileData], { type: 'csv' });
const blob = new Blob([fileData], { type: 'text/csv;charset=utf-8;' });
const url = URL.createObjectURL(blob);

const link = document.createElement("a");
Expand Down

0 comments on commit b756511

Please sign in to comment.