We were having a conversation in German, and I said:
Er mag zwar ein richtiger kleiner Unruhestifter gewesen sein und hatte vielleicht immer nur Unfug im Kopf, aber wenn er sich etwas in den Kopf gesetzt hatte, dann wollte er es auch unbedingt bis zum Ende durchziehen.
I was wondering how I'd express the same idea in French, and I'd have said:
≈ Il était peut-être chahuteur, toujours partant pour faire des bêtises, mais quand il avait une idée en tête, il allait jusqu’au bout.
The expression "sich etw. in den Kopf setzen" -- literally translating as "se mettre en tête" -- tends to have a positive connotation in German, often coupled with something positive like "un but".
In French, the literally translated "se mettre en tête" does not work here due to its pejorative connotation, for one thing, leaving aside the structural difference: "Quand il se mettait en tête de faire qch., ...". Then, three other expressions with the noun "tête" come to mind:
"avoir qch. en tête": the one I used, and the phrase seems to take on a positive or negative meaning, depending on the noun used.
"avoir qch. dans la tête": I get the impression that this one carries a pejorative connotation, as I tend to use it in something like: "Quand il avait une idée dans la tête, il ne l'avait pas ailleurs".
"avoir qch. derrière la tête": I think this one is on the positive side, and with a hint of secrecy, as in "have sth. up your sleeve".