in reply to Unexpected behavior of Perl on non-breaking space in Mac environment

Perl processes the text, but saves the non-breaking space character as "\_"

Sorry, but I think this is likely not the explanation. Instead:

I'm simply using the regular expression to search for particular sequence of letter and replacing them to something else.

Probably this regular expression is making this change, or it could maybe be an encoding issue, but you haven't shown us any code at all, so we currently can't help you.

However, if you can post a Short, Self-Contained, Correct Example that reproduces the issue then I'm sure we can help. In this node I describe what information you should include in your post when debugging unicode issues.

  • Comment on Re: Unexpected behavior of Perl on non-breaking space in Mac environment

Replies are listed 'Best First'.
Re^2: Unexpected behavior of Perl on non-breaking space in Mac environment
by hishii2001 (Novice) on Apr 20, 2022 at 14:23 UTC
    Thank you for your input, and my apology. I realized that my script is grabbing a wrong version of file that already has non-breaking space having as "\_" for some reason. After grabbing the correct version of file set, it's behaving as expected. Thank you as well for pointing me to https://www.perlmonks.org/?node_id=1233709