summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/php.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-02-17 21:49:50 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2013-02-17 21:49:50 +0100
commitd666db48604418eed5aaf76669375e2c9b2bd101 (patch)
tree29fd35a11bb7d3e2e42fbddff16537b5ce249d08 /lib/coderay/scanners/php.rb
parentd0b9a7cc6f78758a35b574f149c2fc3e9a2a8455 (diff)
downloadcoderay-d666db48604418eed5aaf76669375e2c9b2bd101.tar.gz
fix #40 (PHP unicode)
Diffstat (limited to 'lib/coderay/scanners/php.rb')
-rw-r--r--lib/coderay/scanners/php.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/coderay/scanners/php.rb b/lib/coderay/scanners/php.rb
index 8acfff5..3f7ff6a 100644
--- a/lib/coderay/scanners/php.rb
+++ b/lib/coderay/scanners/php.rb
@@ -1,4 +1,4 @@
-# encoding: ASCII-8BIT
+# encoding: utf-8
module CodeRay
module Scanners
@@ -11,7 +11,6 @@ module Scanners
register_for :php
file_extension 'php'
- encoding 'BINARY'
KINDS_NOT_LOC = HTML::KINDS_NOT_LOC
@@ -211,7 +210,7 @@ module Scanners
HTML_INDICATOR = /<!DOCTYPE html|<(?:html|body|div|p)[> ]/i
- IDENTIFIER = /[a-z_\x7f-\xFF][a-z0-9_\x7f-\xFF]*/i
+ IDENTIFIER = 'ä'[/[[:alpha:]]/] == 'ä' ? Regexp.new('[[:alpha:]_[^\0-\177]][[:alnum:]_[^\0-\177]]*') : Regexp.new('[a-z_\17f-\xFF][a-z0-9_\x7f-\xFF]*/', true)
VARIABLE = /\$#{IDENTIFIER}/
OPERATOR = /