Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7967859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:59:13+00:00 2026-06-04T06:59:13+00:00

For non-ASCII characters in file names, Git will output them in octal notation .

  • 0

For non-ASCII characters in file names, Git will output them in octal notation. For example:

> git ls-files
"\337.txt"

If such a byte sequence does not represent a legal encoding (for the command line’s current encoding), I’m not able to enter the corresponding String on command line. How can I still invoke Git commands on these files? Obviously, using the String which is displayed by git ls-files does not work:

> git rm "\337.txt"
fatal: pathspec '337.txt' did not match any files

Tested on Windows, with msysgit 1.7.10 (git version 1.7.10.msysgit.1)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:59:14+00:00Added an answer on June 4, 2026 at 6:59 am

    In Bash, you can use printf for this kind of purpose:

    $ printf "\337.txt"
    ▒.txt
    
    $ git rm `printf "\337.txt"`  # this would pass the awkward filename to git
    

    The problem is, obviously, that the shell doesn’t perform octal escaping, neither does git. But printf does.


    Also, echo -e can do octal escaping:

    $ echo -e '\0337.txt'
    ▒.txt
    

    But that usage is a bit discouraged, you should prefer printf where you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing a file utility to strip out all non-ASCII characters from files. I have
I've got a file (possibly binary) that contains mostly non-printable ASCII characters as the
How do I remove non- ASCII characters from a file?
I want to remove all the non-ASCII characters from a file in place. I
The following code somehow fails to notice any files with non-ASCII characters in their
I have an excel file with numerous Non-ASCII characters which I would like to
Has anyone had experience generating files that have filenames containing non-ascii international language characters?
These days web addresses can also include non-ASCII characters. So every modern browser and
I have non-ascii chars in velocity template files. And when processed they are garbled.
I am having problems with the DictWriter and non-ascii characters. A short version of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.