hitobito / hitobito

A web application to manage complex group hierarchies with members, events and a lot more.
https://hitobito.com
GNU Affero General Public License v3.0
373 stars 109 forks source link

PDF: generieren schlägt fehl wenn gewisse Unicode Zeichen vorkommen #2280

Open daniel-illi opened 9 months ago

daniel-illi commented 9 months ago

Zammad ticket: https://help.puzzle.ch/#ticket/zoom/7184 Sentry issue: https://sentry.puzzle.ch/pitc/hitobito-backend/issues/64870

Aktuelles Verhalten

Bei PBS schlägt das generieren des PDF für eine Kursanmeldung fehl, wenn in den Kursanmeldung Antworten gewisse Unicode Zeichen vorkommen.

Beispiele:

Vermutlich kommen diese Steuerzeichen in die Antworten, wenn diese aus einem PDF Dokument kopiert und im hitobito eingefügt werden.

Das führt zu einem solchen Error:

Prawn::Errors::IncompatibleStringEncoding
Your document includes text that's not compatible with the Windows-1252 character set.
If you need full UTF-8 support, use external fonts instead of PDF's built-in fonts.

app/domain/export/pdf/participation/section.rb in table at line 16
app/domain/export/pdf/participation/specifics.rb in block in render at line 15
app/domain/export/pdf/participation/section.rb in with_header at line 69
app/domain/export/pdf/participation/specifics.rb in render at line 14
app/domain/export/pdf/participation.rb in block in render at line 17
app/domain/export/pdf/participation.rb in each at line 17
app/domain/export/pdf/participation.rb in render at line 17
app/domain/export/pdf/participation.rb in render at line 42
app/controllers/event/participations_controller.rb in print at line 102

Grundsätzlich können alle PDF exports betroffen sein, wo user input verarbeitet wird.

Gewünschtes Verhalten

Wenn von hitobito ein user input akzeptiert wird, dann kann auch ein PDF generiert werden.

Schritte zu reproduzieren

  1. Kursanmeldung erstellen und bei den Antworten unsichtbare Unicode Zeichen einfügen
  2. PDF generieren

Wann ist der Fehler aufgetreten?

No response

hitobito version

No response

Organisation

No response

Screenshots, weiterer Kontext

No response

ToDos

No response

ThomasEllenberger commented 1 week ago

Gemeinsamkeiten mit https://github.com/hitobito/hitobito/issues/2372?