Rereading this patch, I was wondering why we don't know the encoding. A Symfony app has a charset settings which defines the default encoding for the app. So, why not assuming that this is the encoding used by the target URL as well?