views:

140

answers:

2

Hey!

I created a svn hook that calls a php script to send some emails. The problem is that I am getting incorrect encoded msg's (I think that's what you can call it)

This is what I get in my mail:

Modified files - /base/view.php

Mais umas actualiza?\195?\167?\195?\181es

This is what I get when the hook calls the script. But if I call the script directly (specifying the revision) I get this:

Modified files - /base/view.php

Mais umas actualizações

The mail is sent with iso-8859-1 encoding (tried utf-8 and got the same results)

Anyone know what I can use/do to correct this?
Thanks

A: 

It probably has to do with the locale of the executing environment. When you run it yourself it's in your locale, and probably handles the special characters correctly.

I suspect the hook gets executed in the subversion servers locale, which may be the 'C' locale or some locale that doesn't know how to handle those characters.

John Weldon
Thanks. I'll check that out
AntonioCS
A: 

You need to export the LANG in the post-commit hook, otherwise svnlook will output de log in the locale that is set for your SVN user :

(in post-commit, before the call to your script)

export LANG="fr_FR.UTF-8"

Of course, you might adjust to the locale you need, as long as it's utf8.

Bertrand Gorge