When I execute the following command:
svnlook changed {path} -r {rev}
where {path} is the repository path and {rev} is the revision number, I get the following output:
U trunk/this/is/a/path/Mon fichier avec un nom accentu,.txt
The output should actually be:
U trunk/this/is/a/path/Mon fichier avec un nom accentué.txt
The “é” and other accentuated characters are not shown properly…
Is there any way for svnlook to output characters properly?
I know I can use “svn log” with the “–xml” option to get the proper encoding , but I need this for a pre-commit hook, and svn.exe can only get information from revisions, not transactions.
Thanks
The issue you have here is that your pre-commit hook is run by the Subversion binary, which for security reasons passes an empty environment to the hook script. Among the things an empty environment does is remove any specific locale settings, reverting you to the system default (usually ‘C’ or something similar).
To get the correct output from
svnlook, you need to restore the environment you care about before running it. If your script is bash, perhaps something like:In general, any locale with the ‘.UTF-8’ suffix should be fine. Given that you appear to be a French speaker, the ‘fr_FR.UTF-8’ locale would be a reasonable setting.