I have a website that is translated in various languages including French. These pages aren't using Google Translate or any other third party script to do the translations. They have been manually translated.  So on the French's contact us page, I have a php contact form for visitors to fill in. There's french text on the contact us page and I have no problems with character encoding unlike the image below. When the form has been filled in successfully, an automatic message pops up BUT because the french language has special characters, those special characters in the success message have diamond shaped boxes with question marks in it:    MY CODE:  In the header of my contact page I have:  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;   In my PHP form which generates the success message (obviously javascript is used to display the message), I have (this is just a snippet of my entire php code however I think this part is what matters most):  $msg = wordwrap( $msg, 70 );  $headers = "From: $email\r\nBCC:{$bcc}\r\n" . PHP_EOL; $headers .= "Reply-To: $email" . PHP_EOL; $headers .= "MIME-Version: 1.0" . PHP_EOL; $headers .= "Content-type: text/html; charset=utf-8" . PHP_EOL; $headers .= 'Content-Transfer-Encoding: 8bit'. "\n\r\n" . PHP_EOL;  if(mail($address, $e_subject, $msg, $headers)) {    echo "&lt;div class='success'&gt;";  echo "&lt;h6&gt;Nous vous remercions de votre demande.&lt;/h6&gt;";  echo "&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; Si vous n'avez pas reçu une réponse dans 24 heures, veuillez vérifier votre &lt;u style='font-weight:bold'&gt;boîte spam&lt;/u&gt;.&lt;/p&gt;";  echo "&lt;div class='close'&gt;&amp;nbsp;&lt;/div&gt;";  echo "&lt;/div&gt;";    } else {   echo 'ERROR!'; // Dont Edit.   }   Note in the code above:  $headers .= "Content-type: text/html; charset=utf-8" . PHP_EOL;   I suspect and assume that this is where my problem lies:  charset=utf-8   WHAT I'VE DONE IS:  1) I've tried changing my contact page's http-equiv="Content-Type" to  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;   2) and in my php header:  $headers .= "Content-type: text/html; charset=iso-8859-1" . PHP_EOL;   These changes don't work and unfortunately my research on SO isn't getting me closer to a solution (considering everyone's situation is a little different than to perhaps mine). I'm not sure if this header is of any concern?:  $headers .= 'Content-Transfer-Encoding: 8bit'. "\n\r\n" . PHP_EOL;   I appreciate your help and guidance.
326
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
12094
I'd like to use the \hl command from the soul package in a French text. However, it does not work whenever the part to highlight contains French accents (e.g.: \hl{é}).   I could use \'e instead of é (\hl{\'e}) but it would be quite long to substitute all the accents just in case I will have to highlight them later (and there are several accents in French : é, è, ù, à, ...).  Do you know whether it's possible to make \hl works with accents without substituing all the accents?  Here is an example file:   \documentclass[15pt , a4paper]{article}  \usepackage[french]{babel} \usepackage[utf8] {inputenc} \usepackage{soul} \usepackage{color}  \definecolor{y}{RGB}{245, 255, 189} \sethlcolor{y}  \begin{document}   \hl{\'e} % works   %\hl{é} % doesn't work \end{document}
3752
I have PHP configured so that magic quotes are on and register globals are off.  I do my best to always call htmlentities() for anything I am outputing that is derived from user input.  I also occasionally seach my database for common things used in xss attached such as...  &lt;script   What else should I be doing and how can I make sure that the things I am trying to do are always done.
103952
I sometimes see weird characters on some websites instead of what they're meant to display. I've attached an image below as an example. In IE the site displays correctly but on Chrome there are weird characters instead.  My encoding settings on Chrome are set to Auto detect/Unicode UTF-8. I've tried reinstalling all my Windows default fonts too but no success.  Does anyone have a fix for this? Most solutions I've looked at haven't been successful
114665
When I want to execute a php file it's displayed as text in my browser.  I have a VPS at Hostinger I installed Ubuntu 18.04 with Webmin and LAMP(installed automatically).  I checked the installation see below.  apache2 - v and php -v gives me: Apache/2.4.29 and PHP 7.2.24-0ubuntu0.18.04.6  So everything seem to be installed correctly.  My default folder is /var/www/html/ I do not us short tag in my code.  I try to lunch a file called phpinfo.php with content:  &lt;?php phpinfo(); ?&gt;   And plain text appear on the page.  If the file begin with html code it's correctly rendered, even with a .php file. But the php part is not executed. e.g:  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;  &lt;?php phpinfo(); ?&gt;   Render :  Hello  But  &lt;?php phpinfo(); ?&gt;  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;   Render the code as plain text.
16453
Friends, sometimes I had to create a self-contained PHP script. That means the PHP script could have any files within it due to some encoding/decoding algorithm, like Base64. For example,  is a Base64 encoding of this tiny image:   Of course, in this particular case, PHP can handle that huge encoded string because it has a bundled  function.  I was wondering if this idea is possible to achieve somehow in TeX/LaTeX. I need to point out that I'm just curious on this subject, not that I want to embed whatever in code. Besides, as you noted, the encoded string is huge, so that'd surely make people cry blood.  One possible solution I see is if somebody implement an encoding/decoding algorithm in TeX/LaTeX, like \base64_decode, so it would be possible to use something like this: \includegraphics{\base64_decode{\myhugeunreadablestring}}. Sorry for the acid trip ticket, but I'm really curious on how this insane code would work. =)
36272
I am trying to use the MailManager class in Drupal 8 to send HTML mail. I got it working, but it isn't parsing the HTML markup. I think something is wrong with the headers of the email.  What I have is a custom module (Custom_forward) that contains a form and that calls Mailmanager::mail() in its submitForm() method, which contains the following code.          // Email body         $header = $sender . ' thought you would like to see this page from the website.';         $personal_message = $form_state-&gt;getValues()['message_body'];         $entity_url_value = '&lt;a href="' . $entity_url-&gt;toString() . '"&gt;Go to article&lt;/a&gt;';         $message = $header . '&lt;br&gt;' . $personal_message . '&lt;br&gt;' . $entity_url_value;          // Email         $langcode = 'en';         $mailManager = \Drupal::service('plugin.manager.mail');         $to = $form_state-&gt;getValues()['recipient'];          $params['title'] = 'Forward';         $params['message'] = $message;         $result = $mailManager-&gt;mail('custom_forward', 'forward', $to, $langcode, $params, NULL, true);          if ($result['result'] !== true) {             drupal_set_message(t('There was a problem sending your message and it was not sent.'), 'error');             \Drupal::logger('mail-log')-&gt;error($message);         }         else {             drupal_set_message(t('Your message has been sent.'));         }   According to Drupal you also need the hook_mail method in mytheme.theme to be able to send message, you can see this method here:  function custom_forward_mail($key, &amp;$message, $params) {   $message['body'] = [];   $message['subject'] = [];   $message['headers'] = array(     'content-type' =&gt; 'text/html',     'charset' =&gt; 'UTF-8',     'format' =&gt; 'flowed',     'delsp' =&gt; 'yes',     'from' =&gt; \Drupal::config('system.site')-&gt;get('mail')   );    switch ($key) {     case 'forward':       $message['subject'] = $params['title'];       $message['body'][] = '&lt;html&gt;&lt;body&gt;' . $params['message'] . '&lt;/body&gt;&lt;/html&gt;';       break;   } }   As you can see, I am setting the content type to text/html and that should tell the mail system to parse the content as an HTML, but this is not working for some reasons.  This is a testing email. All the HTML markup is not shown, but also not working.  Bassem thought you would like to see this page from the website. personal message Go to article [1] [1] http://myhost/node/81
15704
I know it's of course a dispute whether or not to support foreign languages on StackOverflow. However, my question is a bit different.  is in English, but has code with comments and identifiers in a foreign language. This limits the ability for people to leave answers.  Despite the fact that the example question I linked is poor regardless of language barrier, how should we [the users] handle such questions? Should we...   Accept them into StackOverflow and try to translate them? Cast close votes because we cannot understand to answer? Ask the OP to translate it to English for us? Wait for someone else to come translate it for us?   The same also applies when the code its self includes identifiers in a foreign language. In case this original question I linked gets deleted, here's the source from that question:  procedure TForm1.Button1Click(Sender: TObject); var   X: Integer; begin   for x := 1 to 5 do     if Sender = Botones[x] then //Valida el Boton que provoco el evento     begin       Codigo := x;   //Captura la posicion donde se eonctro el objeto que generó el evento       // ShowMessage(IntToStr(x));       Exit; //sale del bucle     end; end;
43149
I did a search for A$, but a whole bunch of results containing "Å", "A's" and "as" were return, could not find one containing "A$":    Same thing for other special characters such as "#".
75495
Apparently a lot of people complain that they only see random letters and characters:    My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not on my Windows 7 laptop, not on my Android phone or my iPod Touch. It doesn't matter which browser I'm using. The only time I see the problem myself is when I try to share one of my blog posts on Google+, because the blog description then appears in strange characters.  So, first of all I need to find a way to reproduce the problem somehow. Otherwise I won't be able to see if what I did fixed the problem or not.  I did everything that @toscho recommended, but nothing helped.  Did anybody ever run into a similar problem or would you know where I could start to look for the problem?  Edit: I contacted my webhost. They couldn't reproduce the problem, just like me. They said that they have enabled gzip compression on their servers. They suggested turning off one plugin after another to see what happens, but as I can't reproduce the problem, I can't do that. Please help!  More and more readers are complaining about this problem. Most of them just need to refresh the page or wait a few minutes and then the site loads normally, but I'm still using a lot of traffic because of that.  EDIT 2: The W3 Total Cache Plugin FAQ says: I see garbage characters instead of the normal web site, what's going on here?  If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed.  I am pretty sure that none of my code has this call anywhere, but I'm not 100% sure. Is there any way to find out other than searching through millions of characters in all of my files?
67340
Questions like:   ♦ ♦-should-discriminate-more-when-bumping-unanswered-questions ≠-users-who-want-to-write-good-posts   well, you can see there.  The diamond (and other problematic Unicode characters) in the title breaks the automatic prettification of internal question links.  This becomes a bit more of an issue when one wants to link to an answer.  For example ♦-break-the-automatic-hyperlink-parser/242572#242572 should link to Martijn's answer, but, it doesn't (tangent, but a different issue is that  which is the share link doesn't auto-prettify unless the userid part is removed - one keeps having to manually remove things to get the auto prettify to engage).  If one looks at the html generated for  for the title and the url linked in the &lt;h1&gt; of the page, we get:  &lt;title&gt;Users who can&amp;#39;t write good posts ≠ users who want to write good posts - Meta Stack Exchange&lt;/title&gt;     &lt;h1 itemprop="name"&gt; &lt;a href="/questions/238644/users-who-cant-write-good-posts-%e2%89%a0-users-who-want-to-write-good-posts" class="question-hyperlink"&gt;Users who can&amp;#39;t write good posts ≠ users who want to write good posts&lt;/a&gt; &lt;/h1&gt;   And while that's a long link title, I will point out that the quote as part of the word "can't" was removed from the slug.  The bug is that this should be done for other characters too.
38513
Several of my site's pages are appearing in search results with [Translate this page] next to it. When I click that it takes me to Google Translate and translates my page "from Catalan to English".  The pages are in English but have a couple of foreign words (actually Japanese romanisations, not Catalan) that appear to be tripping Google up.  A few weeks ago I set the html tag to &lt;html lang="en"&gt; which from research appears to be the best method to specify the language of a document. Google has cached the pages with this attribute but it is still offering to translate.  More research led me to a "notranslate" attribute which prevents translation entirely: &lt;html lang="en" class="notranslate"&gt;. The problem now is users cannot translate from English to their desired language!  Are there any other solutions that force Google to parse my site as English only?
53551
Some of my script are using different encoding, and when I try to combine them, this has becom an issue.  But I can't change the encoding they use, instead I want to change the encodig of the result from script A, and use it as parameter in script B.   So: is there any simple way to change a string from UTF-8 to ISO-88591 in PHP? I have looked at utf_encode and _decode, but they doesn't do what i want. Why doesn't there exsist any "utf2iso()"-function, or similar?  I don't think I have characters that can't be written in ISO-format, so that shouldn't be an huge issue.
73388
I am using WinEdt to write my thesis and I used   \usepackage[latin1]{inputenc}   to get the French accents to be understood automatically.  It works fine for the first 2 chapters, but for some reason, when I add more chapters, it  gives me this weird symbol whenever I use accents.  This doesn't really make sense as the chapters are all joined to the document the same way!  I really can't see what's wrong.  Any idea?  So here's what it looks like:  \documentclass[msc, index, hyperref, prelimtm]{theseUL1_2}  \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc}  \usepackage{lmodern}     \usepackage[francais]{babel} ... \begin{document} ...  \include{chap1/chap1} \include{chap2/chap2} \include{chap3/chap3}  \end{document}   The chapters are in different files all starting with  \chapter{name} ...
54171
I have a stubborn folder that someone must have created accidentally and that has persisted all this time. I can see it with:  # find /var/www/html -maxdepth 1 -type d   which gives me:  /var/www/html /var/www/html/files /var/www/html/.?   unfortunately the question mark there is not the actual character ?, it merely seems to denote that there is no proper glyph and/or translation for that character. So something like rmdir is out of the question. My system has UTF-8 as the default locale as so many modern Ubuntu systems, but admittedly the folder in question may have originated on a RHEL or CentOS box (tared up and unpacked).  # env|grep LANG LANG=en_US.UTF-8   When trying to cd .\? (as mentioned before it is not actually ?) I get auto-corrected to . by bash and actually end up in /var/www/html/. for some reason. Now if I can't "name" this folder usefully, I cannot access it in any way. How can I get rid of it without putting the whole system in jeopardy?  Now I installed detox already but that only seems to act on files, not folders, according to its documentation and besides it still requires that I be able to name the object somehow to do something with it.
17694
I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?  I'm asking for an explanation of the two and how to choose them.
10708
Some questions, for example    Instead of using a correct URL, such as  http://meta.stackexchange.com/questions/79543/٩●̮̮̃-̃۶-forbid-unicode   are using  https://superuser.com/questions/516363/what-is-the-��-character   What is causing this behavior?