Discussion:
[p4] P4 command line tools - Umlaut in path
Paul Baumgarten
2016-05-19 08:25:10 UTC
Permalink
Hey



I am currently writing a PowerShell2 script for automatizing some build
processes.

Therefore I need to get a set of files which have been modified between two
changelists.

I use p4 files and p4 print to do that. Everything is working fine, but I am
running into problems as soon as there is a Umlaut (ä, ö, ü, etc.) in the
file name of a depot file.



If I run the following command (using invoke-expression):

p4 -s -c <workspace> -Q utf8 -C utf8-bom print -qo "<local path with
Umlaut>" "<depot path with Umlaut>”



I get the following error:

Usage: files/print [-o localFile -q] files...

Option: -o needs argument



Similiar errors occur if I use some other p4 command (like p4 where) or if I
call the command just with the depot path, without –o.



Encoding is set to UTF8 for both Powershell and Console:

$sig = @'

[DllImport("kernel32.dll")]

public static extern bool SetConsoleCP(uint wCodePageID);



[DllImport("kernel32.dll")]

public static extern bool SetConsoleOutputCP(uint wCodePageID);

'@



$type = Add-Type -MemberDefinition $sig -Name Win32Utils -Namespace Foo
-PassThru

$type::SetConsoleCP(65001)

$type::SetConsoleOutputCP(65001)

$OutputEncoding = New-Object -typename System.Text.UTF8Encoding

[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding



* If I run invoke-expression “chcp”, the codepage 65001 is returned.



I also tried to convert the file paths explicitly, which I get by using p4
files, to UTF8, but with no success.



I am currently using Version 2011.1.



Do I miss something? Or is this a p4 bug?



There is a workaround by using p4 sync, which I would like to avoid.

Moreover I could use the p4 .NET API, but we use PowerShell2 and the API, we
have, uses .NET 4.0 and they are not compatible. Even though I could solve
that by getting an older API version.



We are soon switching to the newest p4 version (2015.2). Does this problem
still persist?



Thanks and best regards



Paul













_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/listin

Loading...