Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart/Curly braces in Working with free text (Option 1 - Challenge) #220

Open
nap84 opened this issue Feb 23, 2023 · 1 comment
Open

Smart/Curly braces in Working with free text (Option 1 - Challenge) #220

nap84 opened this issue Feb 23, 2023 · 1 comment
Labels
type:bug Code included in the lesson needs to be fixed

Comments

@nap84
Copy link

nap84 commented Feb 23, 2023

The challenge in Option 1 in Working with free text episode states that ‘smart’ or ‘curly’ quotes have not been removed from the text file in the previous steps. However, when I worked through these steps, these punctuation marks had indeed been removed. Perhaps this challenge should be updated?

I tried this both using bash-3.2 as well as zsh-5.8.1 with Mac osX Ventura 13.1 with the same results.

@kaitlinnewson kaitlinnewson added the type:bug Code included in the lesson needs to be fixed label Sep 8, 2023
@alex-ball
Copy link
Contributor

This is a tr thing, not directly a bash or zsh thing.

Curly quotes are two-byte characters in UTF-8 (U+2018, U+2019). Most implementations of tr, including GNU coreutils used in Linux and the various Bash options for Windows, can only handle single-byte characters (e.g. ASCII, UTF-8 up to U+00FF), so don't recognise the curly quote characters.

Macs use the BSD version of tr. I cannot find any documentation of this anywhere, but it looks like recent versions of BSD tr can handle multi-byte characters and therefore recognise curly quotes as belonging to the [:punct:] class. (Best I can find at the moment is a presentation from 2016 that implies the change happened after that time.)

It sounds like the OpenSolaris/Heirloom Toolchest version of tr has had multi-byte support for much longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Code included in the lesson needs to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants