Mercurial messes scandinavian characters OSX - windows

Me and my friend set up Mercurial repository on Bitbucket for our project. He works on Windows while I use OSX. I installed Mercurial to OSX and cloned the repository only to find out that all scandinavian characters (äö) in files where interpreted wrongly. Also, folders which had those characters didn't get cloned properly.
Now, I suppose it has something to do with character encoding, which makes it somehow work on Windows, but not on OSX. I used Sourcetree as GUI for Mercurial and tried to find any character encoding settings with no results. What I should do to fix this problem? I have used GUI Mercurial on Windows before and never had problems like this.

You have usual "different encoding" problem.
OSX uses UTF8 (FIXME), Windows for Western-Europe 8bit chars (most probably) - ISO-8859-1
Before any CLI-operations in OSX you have to chcp to the same copepage, as it was on Win-side

Related

Git Status hangs using Cygwin

On my Windows machine, I have a repository that works nicely with msysgit. But when I try running git status on cygwin, it just hangs, without printing anything until I press Ctrl-C.
How can I investigate this to find out the reason for such behaviour?
The reason for this was the difference in core.autocrlf setting. When install git for windows, I set it to automatically convert line endings in both directions, so the files in the filesystem were actually different from the files saved in git history - but windows git always hid these differences.
Meanwhile, cygwin git was working extremely slow because it detected differences in every line of thousands of text files in my repository.

Running Tika through tika-python in Windows produces encoding errors

I have python code that extracts text from pdf files using Tika Server through tika-python. It then stores the resulting output in individual json files.
The command I run to execute my script is
python extraction.py <full path to some local directory>
I'm using python 3.5
It works perfect in different MacBookPro computers.
It doesn´t work as expected in Windows, even using up-to-date Windows 10.
Some pdf files are processed, others produce an error such as:
'charmap' codec can't encode characters in position 3648-3649: character maps to <undefined>
I have tried changing the Code Page to 65001 and changing console font to Lucida Console, based on other questions posted on Stack Overflow, including 388490 (Unicode characters in Windows command line - how?) and 14109024 (How to make Unicode charset in cmd.exe by default?) and 1259084 (What encoding/code page is cmd.exe using?).
I also tried installing ConEmu (http://conemu.github.io/en/UnicodeSupport.html) and changing the default encoding for all consoles.
Other references mention win_unicode_console (https://github.com/Drekin/win-unicode-console) but the python patch recommended instructions are not working in my machine.
I use Anaconda as my python distribution.
I am interested in knowing how to be able to run my python code in Windows without having these encoding problems. From what I have read, this is not a problem with my python code nor with Tika Server but rather a Windows encoding issue.
Thank you all,
German

working with git in windows commiting in os x

I just bought a macbook pro to see how it is as a windows developer machine. I am using parallels desktop 9 for mac and it's really rocks. I want to use os x as much as poisable and only use windows for Visual Studio and windows only program, everything else I want to do in os x.
My main concern is git. I am sharing my projects folder with windows and my goal is to do all git related work from the mac bash terminal.
I am worried about line endings and special danish letters like ÅØÆ. Is it a bad idea to work in windows and commit in os x?
This is what I have found out so far:
- git config --global core.precomposeunicode true // so git can reconize øæå in filenames
- if it's a windows repository use core.autocrlf = true
- if it's on mac use core.autocrlf = input
So if I worked on a shared repository and everyone else is using windows with core.autocrlf = true what should I use when I commit from my mac, but do the coding in VS
I have no experience with Danish characters, but I work off windows through VMWare and I set the core.autocrif = true, since it will mess up my clickonce deployments otherwise.
That being said but I would match everyone else with core.autocrif = true, I have noticed things with line endings on the mac side if I'm editing db scripts but haven't ran into any issues with having this setting(mainly a web dev shop)

what's your utf-8 console setting when programming Google Go under Windows

We know google's Go default is UTF-8.
I found in my Windows XP. It can not display correct about the UTF-8.
The following code display in wrong.
package main
func main() {
println("中文")
}
I've googled. It said use another font + reg + chcp 65001.
But, I failed.
I've tried cmd and powershell v1 (it is the only provide version under XP).
Both can NOT display well.
Install MSYS
Download mintty and put mintty.exe in c:\MinGW\msys\1.0\bin
Adjust MinGW Shell icon, set target as C:\MinGW\msys\1.0\msys.bat -mintty, then click the icon
Menu->Option->Text->Font, Locale,Character set(UTF-8)
Download go Windows 386
cd /c/go/src ; mkdir ; test your code here.
BTW, setting vim with utf-8
I will try this the next time I'm at a Windows XP machine. I develop mostly on Win 7 and CentOS. One thought, cmd.exe is awfully old on Windows XP. I wonder if it would work better if run from PowerShell. Also, in the last couple days I've switched to using MSys on Windows so that I can take advantage of unified makefiles on Linux and Windows. I'll post an update if I get the command to work on XP or 7.

Vim configuration throwing errors on one machine but not the other

What might cause Vim to throw errors on one machine but not the other, considering both systems have identical vim configuration?
I have two Mac OS X Lion machines both running the default vim binary that ships with the OS.
I keep my .vimrc and .vim directory in a git repo. However, starting vim on one of these machines throws an error:
Error detected while processing function <SNR>41_CreateMaps..<SNR>41_DefineVariables..AutoClose#DefaultPairs..AutoClose#ParsePairs:
line 18:
AutoClose: Bad pair string - a pair longer then two character
line 19:
E121: Undefined variable: a:sring
E15: Invalid expression: " `- String: " . a:sring
line 20:
`- Pair: «» Pair len: 4
I keep my plugins organized using the Vundle plugin. The error appears to be caused by the AutoClose plugin.
For the sake of austerity, I removed the vim directory and all .vim files in my home directory then sourced everything from the repo and reinstalled the plugins, but the error remains.
I should add that the issue does not come up when launching MacVim, only vim in terminal.
Since vim comes preinstalled with Mac OS X Lion and my other machine (running the same version of Mac OS) does not generate those errors whilst using the same settings, I'm left clueless as to where to look..
In case it makes any difference, both machines have MacVim installed but the error only shows on one of them and only when launching vim from command line.
This is probably because the file is in a different encoding (latin1 vs UTF-8) than VIM expects.
If you put scriptencoding utf-8 at the top of your .vimrc (assuming your vimrc is actually encoded in UTF-8, use ISO-8859-1 if it's encoded in Latin1), everything from that point on should be properly recognised.
To see more documentation about this feature, type :help scriptencoding in vim.
(source: http://vim.wikia.com/wiki/Converting_LANG_to_UTF-8 and vim manual)

Resources