Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Double backslashes when comes to ascii incompatible string. #36

Open
simsicon opened this issue Dec 11, 2013 · 0 comments
Open

Double backslashes when comes to ascii incompatible string. #36

simsicon opened this issue Dec 11, 2013 · 0 comments

Comments

@simsicon
Copy link

Hi guys, when Grit tries to get diffs, and name of files in diffs contains ascii incompatible string like CJK, it would give some unexpected string, like what I did in this test .

Basically a_path/b_path will looks like "\\344\\270\\255\\346\\226\\207.txt", rather than "\344\270\255\346\226\207.txt", single backslash is convertible, double backslashes is not, Ruby consider double backslashes as escaped.

I am thinking of

$SAFE = 4
eval %Q{"#{a_path}"}

like code with safe protecting to eval this string, but I don't think it's the best solution, I don't even think this is a way of solving double backslashes, do you guys have any good ideas? Please check the test to reproduce this problem. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant