Peltoche / ical-rs

Rust parser for ics (rfc5545) and vcard (rfc6350)
Apache License 2.0
110 stars 21 forks source link

replaced split_line with a multibyte aware version #61

Closed ronnybremer closed 9 months ago

ronnybremer commented 10 months ago

split_line was working fine as long as the input was just plain US-ASCII. When using multibyte characters and they happened to be at the end of the line to spit the function did panic.

The new code returns correctly split lines even if they contain multibyte characters.

ronnybremer commented 10 months ago

related to #60

Peltoche commented 10 months ago

Hello @ronnybremer, thanks for the PR. I will take a look asap

ronnybremer commented 10 months ago

Coule you add a test case with your exemple from #60 please? To ensure that will not recreate the bug.

Done. I also fixed the broken test from before, needed to take 75 characters of the first line but only 74 characters of subsequent lines as a " " is added in front of each line.

ronnybremer commented 10 months ago

I had to fix the test, too bad I can't run it myself without checking out the repo. The text variable needs to include the expected line breaks, which I now added. Hopefully it works now. Sorry for the hassle.

ronnybremer commented 9 months ago

@Peltoche would you please start the testing stage again? Thank you.

ronnybremer commented 9 months ago

one last wrong character, can't believe it :(

Peltoche commented 9 months ago

Sorry for the delay.

Peltoche commented 9 months ago

LGTM, thanks for this PR :+1: