I have a .php file saved as UTF-8 and I would like to let it print out a character like €  How can I do it?  This is the source code of the example:  &lt;?php header('Content-Type: text/html; charset=UTF-8');  echo "€"; ?&gt;   The file was saved with notepad++ as UTF-8 but when I execute the file it just prints me out "?"    Answer  While the answer provided here  fullfills various aspect of UTF-8, i found the answer to my question inside  comment.  The .php file was saved as UTF-8 but WITH BOM. Within Notepad++ i choosed Format-> "UTF-8 without BOM" and the script worked.
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.
6897
I'm using TeX with the plain format.  On my keyboard there is the 'è' character (as well as é, ò, à, ù, ì).  I'd like to make it work so that, when put è in the input file, TeX transforms it into \`e, i.e. the letter e with an accent.  I think I have to change the character code of è and do something like that, but I don't know what to do exactly.  Can you help me?
21330
I work in Linux with the latest TeX Live. The system encoding is UTF-8. It is also the default editor encoding in my TeXstudio 2.12.8.  I have figures in files like σ_1_μ_02_per_5.tikz, and I included them using \input{}.   Now, the most interesting part: it had worked fine (even without inputenc etc), then it just stopped. I have not change a single line in my files. Now I get  Package inputenc Error:  Unicode character σ (U+3C3)(inputenc) not set up for use with LaTeX. ...σ_1_μ_02_per_5.tikz   I have tried:   using babel inputenc with utf8, utf8x, latin1 fontenc with different parameters opening and saving in UTF-8 in other editors   And in this case I get:  Undefined control sequence. ...μ_02_per_5.tikz} Missing $ inserted. ...μ_02_per_5.tikz} Double subscript. ...μ_02_per_5.tikz} Undefined control sequence. ...μ_02_per_5.tikz}   How to fix this?    Minimal not working example:  \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \begin{document}     \input{1.tex}     \input{σ.tex} \end{document}
21512
I received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python?  deals with C#.
86625
Im reading in a document that the user uploads from the visualFlow:  &lt;apex:inputFile value="{!contentFile}" filename="{!nameFile}" id="file"/&gt;   And its accessed in apex in this manner:  String nameFile = contentFile.toString();   And it works like a charm. I am able to parse through the document and extract all the information needed, but only for English users. But for Spanish users that's not the case.  Those files have some special characters, and cause a BLOB is not a valid UTF-8 string error.  I've tried to base64Encode the file contents, but the results come out illegible.   String nameFile= EncodingUtil.base64Encode(contentFile);
29690
I'd like to capture the output of  to a string.  The PHP documentation says;     As with anything that outputs its result directly to the browser, the  can be used to capture the output of this function, and save it in a string (for example).   What would be an example of how that might work?  print_r() isn't a valid possibility, because it's not going to give me the information that I need.
83249
Very similar to , except for Java.  What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&amp;", "&lt;", etc.
115935
I have a form with a textarea. Users enter a block of text which is stored in a database.  Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: â€“, â€™, â€œ ,â€  What function should I call on the input string to convert smart quotes to regular quotes and emdashes to regular dashes?   I am working in PHP.  Update: Thanks for all of the great responses so far. The page on Joel's site about encodings is very informative:   Some notes on my environment:  The MySQL database is using UTF-8 encoding. Likewise, the HTML pages that display the content are using UTF-8 (Update:) by explicitly setting the meta content-type.  On those pages the smart quotes and emdashes appear as a diamond with question mark.  Solution:  Thanks again for the responses. The solution was twofold:   Make sure the database and HTML files were explicitly set to use UTF-8 encoding. Use htmlspecialchars() instead of htmlentities().
90393
What is the name of the character whose code is $\wp$ ?  Thanks
51125
I have code like this in php:  header("Content-Type: text/plain"); exec("/bin/bash -c 'ls --color=always'", $result); echo implode("\n", $result);   and I've got result (escape is not visible)  Makefile README Yann Tiersen - Comptine d'un autre ete L'apres midi.mp3 bush-src.js bush.js bush.min.js [0m[01;34mcgi-bin[0m config.json [01;34mcss[0m favicon.ico foo.png index.php [01;34mlib[0m ls.txt test.php test.php~ [01;32mtest.txt[0m   It show ANSI escape codes for directories and executable files, but when I call from command line  php -r "exec('bash -c \"ls --color=always\"', \$result);echo implode(\"\\n\", \$result);" | less   I've got this:  bush.js bush.min.js bush-src.js ESC[0mESC[01;34mcgi-binESC[0m config.json ESC[01;34mcssESC[0m favicon.ico ESC[01;35mfoo.pngESC[0m index.php ESC[01;34mlibESC[0m ls.txt Makefile README test.php test.php~ ESC[01;32mtest.txtESC[0m ESC[00;36mYann Tiersen - Comptine d'un autre ete L'apres midi.mp3ESC[0m   png and mp3 have ANSI escapes codes, why php exec from webpage don't give that as return?
105734
In my web app, I submit some form fields with jQuery's $.getJSON() method. I am having some problems with the encoding. The character-set of my app is charset=ISO-8859-1, but I think these fields are submitted with UTF-8.   How I can set encoding used in $.getJSON calls?
47610
This has been confusing me for some time. With the advent of UTF-8 as the de-facto standard in web development I'm not sure in which situations I'm supposed to use the HTML entities and for which ones should I just use the UTF-8 character. For example,   em dash (–, &amp;emdash;) ampersand (&amp;, &amp;amp;) 3/4 fraction (¾, &amp;frac34;)   Please do shed light on this issue. It will be appreciated.
27341
Is there an easy way of getting the charset and collation of the DB tables in WordPress without resorting to SQL queries?
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.
34476
With reference to the following thread:   What is the best way to programatically determine the correct charset encoding of an inputstream/file ?  I have tried using the following:  File in =  new File(args[0]); InputStreamReader r = new InputStreamReader(new FileInputStream(in)); System.out.println(r.getEncoding());   But on a file which I know to be encoded with ISO8859_1 the above code yields ASCII, which is not correct, and does not allow me to correctly render the content of the file back to the console.
67110
What I want to do is to remove all accents and umlauts from a string, turning "lärm" into "larm" or "andré" into "andre". What I tried to do was to utf8_decode the string and then use strtr on it, but since my source file is saved as UTF-8 file, I can't enter the ISO-8859-15 characters for all umlauts - the editor inserts the UTF-8 characters.  Obviously a solution for this would be to have an include that's an ISO-8859-15 file, but there must be a better way than to have another required include?  echo strtr(utf8_decode($input),             'ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ',            'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy');   UPDATE: Maybe I was a bit inaccurate with what I try to do: I do not actually want to remove the umlauts, but to replace them with their closest "one character ASCII" equivalent.
85743
I am working on a project that uses a CSV file supplied by the client to populate a database. The client is to create the spreadsheet, then save it as a CSV to be uploaded, which is then parsed into a database.  The problem is, whenever the client saves the excel spreadsheet as an MS-DOS .csv file, many of the special characters get converted to question marks "?" (symbols such as ' " / ). However, if we then open the CSV file and manually replace each ? with the right character it works fine.  The problem is that the data file is HUGE, and we can't reasonably do this, so I was hoping there was a way to save it. We have tried exporting as Unicode and ASCII to no avail. We have also tried uploading to google docs, and re-saving, however, it also breaks those characters.