Fix for unicode issues in staticweb

When prefix or subdir is unicode, it fails.
Fixes: bug #1158092

Change-Id: I966a7a198a5ca5ea152872c94240e8c2ebe57d36
(cherry picked from commit 05c8d61aebb39d8695c5b295ff399e87e4749540)