On 12/12/2013 9:40 AM, Patrick Gundlach wrote:
Hi all,

this has to do with the discussion we had about the selene unicode library a 
few years ago. Here is a quiz for you. You might think about it first, before 
trying it out.

----------------------------------
match = unicode.utf8.match

if match("à","%s") then
     print("space")
else
     print("not a space")
end

if match("á","%s") then
     print("space")
else
     print("not a space")
end
----------------------------------


Now, what is printed?

à : C3 A0
á : C3 A1

A0 == nbsp

when you make a more complex pattern it's okay so i think it's an optimization issue: "%s" take another route, so a bug in selene

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

Reply via email to