Arabic user data that was captured with our web-to-lead form occasionally ends up Mojibake in our lead table. A user would type something like:
الإعلان العالمى لحقوق الإنسان
When we retrieve the message from the database, it reads:
ï»¿Ø§Ù„Ø¥Ø¹Ù„Ø§Ù† Ø§Ù„Ø¹Ø§Ù„Ù…Ù‰ Ù„ØÙ‚ÙˆÙ‚ Ø§Ù„Ø¥Ù†Ø³Ø§Ù†
The form is in an embedded iframe page with these tags:
<!DOCTYPE HTML> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> <!-- other header elements --> </head> <body> <form accept-charset="utf-8" action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="post"> <!-- other body elements --> </body> </html>
After first noticing the problem I added the
accept-charset attribute to the form tag. Is there anything more I can do in the page markup that can prevent the problem?
Since the character scramble only happens occasionally, what is the best way to try and replicate / isolate the problem? We have several triggers running after a lead insert and logging all web-to-lead activity generate a fantastic amount of raw data to wade through to try and spot the occasional culprit. Not sure what to look for anyway. User agent signature? Characters falling outside/inside a certain unicode range?