How to enter in chinese filename in Windows command prompt window?
Suppose you have a filename 公司File.txt somewhere.
And you want to execute the md5sum.exe program on that file.
md5sum.exe 公司File.txt
You will get...
md5sum.exe: ??File.txt: Invalid argument
Thanks.
You should be able to do
chcp 1201
in the command prompt, if you have installed the Chinese language pack. You could also try 65001, but apparently this is not compatible with your Chinese file name.
Related
I am running a Windows batch script. When it encounters a filename that contains an emoji the script balks.
can't open input file `??.mp3': Invalid argument
I have tried setting the code page to Unicode, but it doesn't help.
chcp 65001
If I execute the dir command in a cmd.exe window, the emoji shows as a box. How can I support emojis in a Command Prompt window or batch script?
I'm on Win10 and I have a .bat file to rename a bunch of files. Some of the entries need to be renamed to a non-English name, e.g.
RENAME "MyFile1.txt" "Eisenhüttenstadt.txt"
However, when I run this, the 'ü' comes out as something else, other characters with an umlaut also are replaced by different characters.
I've tried saving the .bat file in Notepad with Unicode and UTF-8 encoding but then Windows doesn't recognise the command when I try to run it.
I've read this and other similar issues but not found a solution, surely it's simple when you know how?
Any suggestions?
The default code page in the console is 437(USA) or 850(Europe), which does not support characters with umlaut, so you must change this to 1252(West European Latin). So, use Chcp command in the beginning of your batch file to change it, like this:
Chcp 1252
Example:
image via http://www.pctipp.ch/tipps-tricks/kummerkasten/windows-7/artikel/windows-7-umlaute-in-batch-dateien-55616/
Sources:http://ss64.com/nt/chcp.html , http://www.pctipp.ch/tipps-tricks/kummerkasten/windows-7/artikel/windows-7-umlaute-in-batch-dateien-55616/ (The article says for Windows 7 but this applies for Windows 10 too)
am trying to using actvperrl to install prerequsist for bugzila but when trying to run this script from cmd running as administrator
ppm install TimeDate
I get the following error
ppm install failed: The locale codeset (cp720) isn't one that perl can decode, s
topped
even if am using English , any idea how to fix that
It seems like a bug in on windows for number of the active console code page cp720.
You can change this code with command prompt by inserting chcp nnn, where nnn specifies the code page ( example : chcp 850), you can find a list of cp here. but you must repeat the same steps each time you want to open tlmgr.
You can automate the previous steps by inserting the command chcp nnn directly in cmd.
chcp 850
I'm running this command in a .bat or .cmd file to launch an ftp script:
ftp –v –i –s:test_script.txt
Command window converts it to this:
ftp ûv ûi ûs:test_script.txt
And thus it does not work.
Note: if I manually run the above command from a cmd window, it works fine. Only fails when I launch it as a .bat or .cmd file.
Need help preventing the conversion. Thanks.
The dashes you have in the command you've provided are ASCII 150, but the dashes used in switches to commands are ASCII 45. I would guess you have copy/pasted this command from a Word doc or email where the editor "helpfully" changed the dashes to em-dashes.
If you copy/paste your command from this question into a cmd window, it won't run properly because of the wrong dashes. Are you retyping it at the command line, perhaps, rather than copy/pasting?
Regardless, the solution is to retype the dashes in your batch file.
I have installed PostgreSQL, wanting to set up a new database, everything is going fine, until I am trying to use the € sign. And then I knew, that warning I get in the beginning is for a reason.
The warning I am getting at starting up my psql shell is:
WARNING: Console code page (850) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
So I am going to do as I am told (from PostgreSQL Documentation 9.2 - psql):
Notes for Windows Users
psql is built as a "console application". Since the Windows console windows use a different encoding than the rest of the system, you must take special care when using 8-bit characters within psql. If psql detects a problematic console code page, it will warn you at startup. To change the console code page, two things are necessary:
Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code page that is appropriate for German; replace it with your value.) If you are using Cygwin, you can put this command in /etc/profile.
Set the console font to Lucida Console, because the raster font does not work with the ANSI code page.
When I type the cmd.exe /c chcp 1252 command I get a syntax error. So psql, doesn't recognize the command.
Out of desperation, I was trying to do something in cmd.exe itself, does not work either.
I work in Windows 7 - 64Bit.
What is your database Character Set? If it is UTF-8, then before running, what ever you want in psql, just tell the console to use the UTF-8 encoding:
cmd.exe /c chcp 65001
I had the same problem in Windows 10.
In psql type ! chcp
it revealed my setting as 850. This I changed to 1252 by doing the following.
! dir revealed a file runpsql.bat in C:\Program Files\PostgreSQL\9.6\scripts
From windows after exiting psql I ran Notebook in Administrator mode and added above the REM Run psql statement the command chcp 1252
Now runs without the warnings
As far as I know, in SQL shell you just need to type \! chcp <codepage_you_need>.
Still, after that, you might encounter another issue:
In order to solve this problem you need to go to properties (left upper corner) -> Fonts -> choose Lucida Console.
Then type \! chcp 1251
After that, everything must be alright.
I was able to fix this by running SET CLIENT_ENCODING TO 'UTF-8'; in the sql bash
I had the same problem in Windows 8.
You have to set the chcp to 1252.
With the command cmd.exe /c chcp 1252, or, if you are using powershell: powershell /c chcp 1252.
You can also use powershell /c chcp 1252.
But you have to type it before enter in the psql console.
Edit runpsql.bat (folder ...\PostgreSQL\XX\scripts)
On the next line after #echo off write: cmd /c chcp 1252 and save (you need admin permissions).
Screenshot runpsql
Results