Skip to content

[Textpow 1.3.1] warning on bad unicode syntax #1

@grosser

Description

@grosser

Introducing myself : I work in a French company, developing enhancements on our Redmine instance.
I am migrating our developments to the last version of Redmine using Rails 3.

Some Textpow syntax yaml files trigger an annoying warning :
Ignored utf8 regex error invalid multibyte escape: /($)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*?\b/

I tried to see why, and here is what I found :

The two syntax triggering the warning are :
textpow-1.3.1/lib/textpow/syntax/source.smarty.syntax: match: ($)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]?\b
textpow-1.3.1/lib/textpow/syntax/source.mel.syntax: match: ($)[a-zA-Z
\x7f-\xff][a-zA-Z0-9_\x7f-\xff]_?\b

What I understand is that these regexp contain an unicode range \x7f-\xff, but with rails 3 this unicode range is interpreted as real unicode.
The problem is that the range \x7f-\xff is outside utf8 legal values.

I know that you can specify to not interpret unicode character in full regular expressions, with adding a n at the end :
//no
But the syntax is different in the yam file (no /...../)
I did not find how to specify a range of ascii characters between 127 and 255.

The other question is why smarty and mel want such characters in variables names ?

Have you other ideas about this issue ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions