octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59314] [octave forge] (mapping) str2angle fai


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #59314] [octave forge] (mapping) str2angle fails to parse string with UTF-8 degree (°) character
Date: Thu, 22 Oct 2020 04:56:56 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36 Edg/86.0.622.48

Follow-up Comment #7, bug #59314 (project octave):

I believe, it makes sense to apply the original patch.

Look at this part of the original expression: "([^+-]\s?)".
It matches one single character potentially followed by a white space
character. IIUC, that will e.g. match "°" or "° " in Octave 6 and later. But
because the UTF-8 encoded "°" is actually two bytes, it won't match any of
these strings in Octave 5 or earlier.
If you don't like that "°" is matched literally, you could also use
"([^+-]{1,4}\s?)". But I'd argue that the original patch is probably safer.

If you are worrying that the additional complexity might slow down processing,
you could run performance tests. If you find that there is an impact on
performance, only use the more complex regex in Octave 5 and earlier.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59314>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]