Comments (6)
I think PHP is scanned as ASCII-8BIT (same as BINARY) right now because I read that's how it's supposed to be scanned. If newer PHP versions can handle code like this, we have to update the scanner.
from coderay.
Thanks to answer korny! The problem even bigger. UTF in php syntax is quite new thing. But not-ascii comments - this is what people did...like really long time.
And check same link (changed it) http://coderay.rubychan.de/rays/7695
function php中文() {
// Even in comment! russina comment here: Руский комментарий тут
$issue = 'there is a encoding issue in php highlighting';
}
We use coderay in redmine on PHP project and this is big problem for us.
Can you help and tell how hard to fix at last comments encoding? Is it easy, like change in PHP < Scanerr this line code
encoding 'BINARY'
or we need to go deeper?
I would like try to fix at last comments for php, but if you will show a way - this will help a lot.
from coderay.
One more thing, php hightlighting works good with redmine 2.0.4 on my Mac (coderay 1.0.8), but works not good on my another redmine 2.0.4 in centOS (coderay 1.0.8) .
I can provide more infomation if you need.
from coderay.
Mac:
Environment:
Redmine version 2.0.4.stable
Ruby version 1.8.7 (universal-darwin12.0)
Rails version 3.2.6
Environment production
Database adapter MySQL
Redmine plugins:
redmine_redcarpet_formatter 2.0.0
CentOS:
Environment:
Redmine version 2.0.4.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.6
Environment production
Database adapter MySQL
Redmine plugins:
redmine_redcarpet_formatter 2.0.0
from coderay.
using rvm on mac,
if the ruby version is 1.9.3 (x86_64-darwin11.4.0) ,
utf8 does not work with coderay php scanner
if the ruby version used is system 1.8.7 (universal-darwin11.0),
utf8 works with coderay php scanner
from coderay.
Ruby 1.8.7 didn't support encodings, so the UTF-8 codepoints probably passed through CodeRay as if they were ASCII-8BIT/BINARY. On the other hand, Ruby 1.9.x has support for encodings, which could explain the difference you are seeing.
from coderay.
Related Issues (20)
- Could the API for CodeRay.scan(dataset, :python).term also allow for some variant that works on the file extension? (e. g. "rb" for ruby files, "py" or python files etc..)
- ActionView::Template::Error (Symbol or String expected, but NilClass given.)
- Elixir Scanner HOT 1
- Regex with slashes are broken for Javascript
- add 1C Enterprise syntax
- Placeholder $ character in prepared statements (SQL) is marked invalid
- Misaligned line numbers in diff files with `line_numbers: :inline` HOT 1
- Install coderay with permission error in macosx HOT 1
- Invalid rdoc option in gemspec
- CodeRay hangs on multi-code in content
- Add support for CakePHP ctp template
- Support for Kotlin
- Coderay breaks with embedded backticks
- Uninitialized constant Coderay (Redmine 4.1)
- $ method in Groovy code is highlighted as error
- ruby 3.0: test/unit/suite.rb fails due to change in flatten behavior for subclass of Array
- Support for C#
- Support for GraphQL
- License? HOT 1
- Can we easily redefine the colours? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coderay.