Class: Gitlab::Unicode

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/unicode.rb

Constant Summary collapse

BIDI_REGEXP =

Regular expression for identifying bidirectional control characters in UTF-8 strings

Documentation on how this works: idiosyncratic-ruby.com/41-proper-unicoding.html

/\p{Bidi Control}/
SPACE_REGEXP =

Regular expression for identifying space characters

In web browsers space characters can be confused with simple spaces which may be misleading

/\p{Space_Separator}/

Class Method Summary collapse

Class Method Details

.bidi_warningObject

Warning message used to highlight bidi characters in the GUI



20
21
22
# File 'lib/gitlab/unicode.rb', line 20

def bidi_warning
  _("Potentially unwanted character detected: Unicode BiDi Control")
end