Skip to content

Instantly share code, notes, and snippets.

@Glutexo
Created May 11, 2018 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Glutexo/f06dbb69fe9dfc40b6596515ed5756d3 to your computer and use it in GitHub Desktop.
Save Glutexo/f06dbb69fe9dfc40b6596515ed5756d3 to your computer and use it in GitHub Desktop.
Converts non-ASCII chars of the current path to bash string entities
(File.realpath('.').each_char.map do |char| char.ascii_only? ? char : "\\u#{char.ord.to_s(16).rjust(4, '0')}" end).join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment