L
L
lololololo2018-05-12 19:20:21
PowerShell
lololololo, 2018-05-12 19:20:21

Powershell swearing at unicode?

ren "РУКРВВЕРХ! - Чужие Губы.mp3" 
# Incomplete string token.
# At file.ps1:1 char:41
# + ren "РУКРВВЕРХ! - Чужие Р“С <<<< ѓР±С‹.mp3"

rgho.st/private/88rPvDvBF/f98675d843cdc15fd153dcf4...
Localized to
ren "“С"
What does he need?
And what the heck is this?
ren '’ Р’' 1
# Rename-Item : Cannot bind argument to parameter 'Path' because it is an empty string.
# At file.ps1:18 char:4
# + ren  <<<< '’ Р’' 1

How else can you rename files with unicode names? Bat is leaving?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
azarij, 2018-05-12
@azarij

try enclosing the string in single quotes:
rename-item 'P RЈRљP R'R'R•R RҐ! - R§SѓR¶RёRµ P“SѓR±S‹.mp3'
rename-item -path 'P RЈRљP R'R'R•P RҐ! - Чужие Губы.mp3' -newname 'new-name.mp3'
although there is a single quote in the name ...
then you need to try to escape it - \'
and you can also try move-item with -literalpath key.

V
Vapaamies, 2018-05-22
@vapaamies

For the compiler, I needed my own processing of Unicode with automatic recognition of UTF-8, the LiteConv utility - from the code examples for the library. Automatically recognizes what is needed - recodes what is not needed - does not spoil:
LiteConv-r825
This is if suddenly PowerShell is not necessary to use, but you just need to rename the files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question