File: utf8_match.rb

package info (click to toggle)
ruby-websocket-driver 0.6.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 188 kB
  • sloc: ruby: 1,203; java: 44; ansic: 33; makefile: 3
file content (6 lines) | stat: -rw-r--r-- 345 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
module WebSocket
  class Driver
    # http://www.w3.org/International/questions/qa-forms-utf-8.en.php
    UTF8_MATCH = /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/
  end
end