pscp and UTF-8 characters

1

I'm having trouble copying files with UTF-8 characters using pscp on Windows. I'm using command line for that and following command:

chcp 65001
pscp -scp -p -pw {pass} -batch "user@remote_host:/Справочник/file.txt" "E:\Справочник\file.txt"
scp: E:/??????????/file.txt: Cannot create file

As shown I get scp: E:/??????????/file.txt: Cannot create file error. How can I transfer files with UTF-8 characters in their path?

matt

Posted 2014-06-16T11:33:06.513

Reputation: 491

Уберите из пути ? Not use in path ? chcp 866 – STTR – 2014-06-16T12:01:38.457

I have to work with all characters, not only Cyrillic. – matt – 2014-06-16T12:25:08.777

Use Lucida console fonts and chcp 65001 – STTR – 2014-06-16T12:39:13.960

Answers

0

Application registry setting UTF-8 font (example:cmd)

Use path to pscp

Way-1, powershell:

Application path, change \ to _:

AppUTF8Font.ps1:

$app='.\%SystemRoot%_system32_cmd.exe'
SL HKCU:\Console;NI $app;SL $app

New-ItemProperty . FaceName -t STRING -va "Lucida Console"
New-ItemProperty . FontFamily -t DWORD -va 0x00000036

enter image description here

Need allow local powershell script:

powershell -command "Set-ExecutionPolicy RemoteSigned"

And run:

powershell .\AppUTF8Font.ps1

Way-2, reg-file:

Or use reg-file:

REGEDIT4

[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
"FaceName"="Lucida Console"
"FontFamily"=dword:00000036

Command line:

REG IMPORT Cmd_UTF8.reg

Delete setting reg-file:

REGEDIT4

[-HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]

Command line:

REG IMPORT Cmd_UTF8_Delete.reg

STTR

Posted 2014-06-16T11:33:06.513

Reputation: 6 180