u01jmg3 / ics-parser

Parser for iCalendar Events • PHP 8+, 7 (≥ 7.4), 5 (≥ 5.6)
MIT License
439 stars 144 forks source link

Non-breaking spaces are removed from DESCRIPTION #333

Closed albig closed 4 months ago

albig commented 4 months ago

PHP Version

8.2.15

PHP date.timezone

Europe/Berlin

ICS Parser Version

3.3.1 / master

Operating System

Linux

Description

If an event contains a non-breakable space (\xA0) in the DESCRIPTION, this space will be removed by ics-parser. This happens in removePrintableCharacters in https://github.com/u01jmg3/ics-parser/blob/master/src/ICal/ICal.php#L2463.

I wonder, why this is done and why this space is not replaced by an ordinary space instead?

A Sample ICS-File is this: E6F2B1A6-D81E-4BAB-9680-97CCB60AFB78.ics.txt

The resulting description is

2024-02-20_10-37

Of course, this can be fixed easily by the client itself and in the sample case, there is no need to use non-breakable spaces. But you know, not everybody is a nerd ;-)

Importing the same event into Thunderbird or the Linux cinnamon calendar just keeps the non-breaking space as is.

Steps to Reproduce

u01jmg3 commented 4 months ago

PR welcome