I'm using MSYS in windows environment (not my choice), and some of my files are inside folders with names in a different encoding than that of the MSYS console.
So, how can I change the encoding used by the MSYS shell?
Right click on menu bar, choose "Options..."
In the "Text" section, select your encoding.
Related
I'll now be working between a Mac and a PC using R/RStudio for the projects. I've got a series of keyboard shortcuts (pipe, assignment operator) for each machine using keys that are conveniently located. The two computers don't have the same keyboards.
I'd like to create a script that I can run that tells R/RStudio to change all keyboard shortcuts to x or y? My question is: Can keyboard shortcuts be set using code in scripts or the terminal?
According to the documentation :
The RStudio keybindings are saved as JSON files in the directory ~/.R/rstudio/keybindings/ -- you can find the bindings for the editor and RStudio itself at:
~/.R/rstudio/keybindings/rstudio_commands.json
~/.R/rstudio/keybindings/editor_commands.json
I think you can make a script that edit json then restart R
These are instructions to generating a script in Linux
"You should start a script by issuing the command
script a2-script
This will create a file a2-script, which will log input and output at the terminal until you stop the script by typing
exit"
How do I do the same thing in windows 10? I tried typing sciprt a2-script in command promt but I get a message saying that the word script is not a recognizable command
The script command records everything you type and everything that is output on your Terminal. You can't do that in Windows easily.
The best thing to do is ignore that step and run the rest of the instructions and, when the screen is full, right-click in the window's title bar and choose edit->mark and select the text you want, then right-click in the title bar again and click edit->copy. Now you have a copy of the window and you can go in a MS-Word document, or any text editor and paste the contents to have a record of what you did.
Everything is in the title.
file.remove("test.txt") deletes the file completely, I would like to send it to trash as if I used the UI of the OS (like Finder in OSX). Is it possible in R?
I print messages with diacritics in my console application. I tried to set multiple encoding commonly used for my language (CZECH) but non of them is giving me the desired result. I tried UTF-8, Windows(CP1250), ISO 8859-2...
Is there a way how to force console to use some specific encoding?
Or at least where can I find which encoding does my console use?
Thanks in advance.
EDIT: Using Windows 7 - basic command line console ( cmd.exe )
To display the current codepage in cmd.exe:
chcp
To change the current codepage, e.g., to CP-1250:
chcp 1250
By default, the Windows console uses the OEM encoding. There are three encodings for APIs in Windows OEM, ANSI and Unicode. CMD.exe when normally executed uses OEM.
UTF8 seems to be possible, but needs
starting the console with "cmd /u" (create a shortcut)
setting the codepage to chcp 65001
choosing a unicode capable font (e.g. Consolas 20) in the settings of the shortcut
I have the following:
Q_ASSERT(QFile::exists("\\.host\Shared Folders\username On My Mac\Desktop\New Deck.txt"));
The file is picked from QFileDialog but when check if it exists with QFile::exists it returns FALSE;
Is there any reason why QT cannot open a file on a shared drive.
Btw, this path is a valid one on Windows and is generated by putting the "New Deck.txt" file on my Mac OSX desktop and tried to be read from a QT application run from VM Ware Windows XP SP2.
You must escape \ in the string literal via \: "\\.host\Shared Folders\..."
Also, unless this is for your debugging only, asserting on the existing of files is a bad idea. The file could always disappear between selecting it in the file dialog and opening it.