Skip to content

Commit

Permalink
JRUBY-5615: __FILE__ corrupts cyrillic characters (partial/common case)
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Apr 11, 2011
1 parent 928dca4 commit 3dbefe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/org/jruby/parser/ParserSupport.java
Expand Up @@ -284,7 +284,8 @@ public Node gettable(Token token) {
case Tokens.kFALSE:
return new FalseNode(token.getPosition());
case Tokens.k__FILE__:
return new FileNode(token.getPosition(), ByteList.create(token.getPosition().getFile()));
return new FileNode(token.getPosition(), new ByteList(token.getPosition().getFile().getBytes(),
getConfiguration().getRuntime().getEncodingService().getLocaleEncoding()));
case Tokens.k__LINE__:
return new FixnumNode(token.getPosition(), token.getPosition().getStartLine()+1);
case Tokens.k__ENCODING__:
Expand Down

0 comments on commit 3dbefe3

Please sign in to comment.