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

Double backslashes when comes to ascii incompatible string. #36

@simsicon

Description

@simsicon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions