I have ñ's and á's in the cells of my database. My collation is set to utf8, but on the website my characters are not displaying right.  Esperamos que disfrute del programa y aprenda bastantes consejos  �tiles para padres para mejorar el desarrollo de su hijo. Tambi�n  puede aprender de otras mam�s y ellas de usted. El Foro...   Displaying it via SELECT statement and then through php on the page. Let me know if you need more information. Perhaps this is a common problem?
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.
17325
I have a MySQL table with utf8 general ci collation. In the table, I can see two entries:  abad abád  I am using a query that looks like this:  SELECT *  FROM `words` WHERE `word` = 'abád'   The query result gives both words:  abad abád  Is there a way to indicate that I only want MySQL to find the accented word? I want the query to only return    abád    I have also tried this query:  SELECT *  FROM `words` WHERE BINARY `word` = 'abád'   It gives me no results. Thank you for the help.
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 "#".
61185
I'm trying to remove some characters from file(UTF-8). I'm using tr for this purpose:   tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat    File contains some foreign characters (like "Латвийская" or "àé"). tr doesn't seem to understand them: it treats them as non-alpha and removes too.  I've tried changing some of my locale settings:  LC_CTYPE=C LC_COLLATE=C tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=C tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat   Unfortunately, none of these worked.  How can I make tr understand Unicode?
2751
I noted that if I use comment.sty and a there is a block of text containing UTF8 characters inside a comment environment, the compilation aborts!  Minimal Example  \documentclass{article} \usepackage[T1]{fontenc} \RequirePackage[utf8]{inputenc}%this file is stored as UTF8 file! \RequirePackage{comment} \specialcomment{privateSolution}     {\begingroup\itshape\noindent\textbf{Solution}\\}     {\endgroup} %\excludecomment{privateSolution}%Use it to remove solutions!  \begin{document} \title{Comment.sty and UTF8 test file} \maketitle \section{UTF8 character test} In which alphabet characters àìùòè are common? \begin{privateSolution}     The Italian alphabet contains àìùòè. \end{privateSolution}  \begin{comment}     The Italian one! It contains àìùòè. \end{comment} \end{document}   Has anyone the same problem? Any workaround?  Thanks in advance.
105113
In PostgreSQL, what is the difference between collations C and C.UTF-8?   Both show up in rows of pg_collation. Is it perhaps the case that C.UTF-8 is the same as C with encoding UTF-8 regardless or what the actual encoding of a database is?
122159
Is there a way to have a statement across multiple lines without the underscore character?  It is really annoying in multi-line strings such as SQL statements, and especially  queries.  Beside from the ugliness and difficulty when changing a line (nothing lines up anymore), you can't use comments in the middle of the multi-line statement.  Examples of my daily personal hell.  dim results = from a in articles _               where a.articleID = 4 _ ' articleID     - Nope, can't do this               select a.articleName   dim createArticle as string = _     "Create table article " &amp; _     "    (articleID int " &amp; _     "    ,articleName varchar(50) " &amp; _     "    )"
73925
Earlier today a question was asked regarding .  The top answer, at time of writing, suggests in PHP just using htmlspecialchars and mysql_real_escape_string.   My question is: Is this always enough? Is there more we should know? Where do these functions break down?
50683
I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars.
115591
In a fairly unique situation, my team has ended up with UTF-8 bytes in a database that thinks the data is encoded as latin1.  At least, I'm 85% certain that this is the situation at hand.  For example, a  was handed to the database by  and just treated the data as raw bytes (0xE2 0x80 0x99). This data, as far as I can tell (how to verify?), was stored as those actual bytes. So now when the data is read out by a more intelligent programming language (Ruby 1.9), the database helpfully says , and so instead of "Mike’s", we end up with "Mikeâ€™s". This is also what I get in the mysql prompt when SELECTing that value.  So, essentially, we have a bunch of utf-8 encoded data stored in a database that thinks the data is encoded as latin1.  This makes me to somehow tell the database "No, no matter what you think, this stuff is actually utf-8". CONVERT TO doesn't seem like the right tool, because then I'll end up with permanent "Mikeâ€™s".    Failed/moronic attempt #1  I noticed this:  &gt; SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; +--------------------------+-------------------+ | Variable_name            | Value             | +--------------------------+-------------------+ | character_set_client     | utf8              | | character_set_connection | utf8              | | character_set_database   | utf8              | | character_set_filesystem | binary            | | character_set_results    | utf8              | | character_set_server     | latin1            | | character_set_system     | utf8              | | collation_connection     | utf8_general_ci   | | collation_database       | utf8_unicode_ci   | | collation_server         | latin1_swedish_ci | +--------------------------+-------------------+   And thought that maybe changing character_set_results to latin1 would trick it into not doing any conversion of the bytes, resulting in the proper display of data on my utf8 OS.  Sure enough, SET character_set_results=latin1; results in ’ instead of â€™. Cool!  So I added this to my ~/.my.cnf (which is the only my.cnf, I checked):  [mysqld] ... character-set-results=latin1   and when I go back to the MySQL prompt &amp; check the character_set_% variables, it's still utf8.  Yes, it just occurred to me that mysqld is a deamon, which means I probably need to restart the whole mysql process for this to take effect. But whoever installed MySQL on this machine used the dmg instead of the brew (wasn't me!) and the MySQL pref pane is currently telling me that MySQL isn't running even though it clearly is, and anyhow before I go down that rabbit hole, I want to check with an actual DBA and see how ridiculous this is, or if there's just a better, cleaner way to do it.
76738
I have a webserver administration question. In this website:   All PHP generated pages contain the following line:  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /&gt;   But this is somehow disregarded probably via the php-apache processing and the page displays in browsers with an UTF-8 header. As a result of that question marks (�) are shown in the page text instead of accented characters (éáöőóüűúí). I tested this in Firefox, IE, Chrome and Seamonkey.  The strangest in this phenomenon, that this symptom started only yesterday, after I upgraded my server to Debian 8.0 Jessie from 7.0 Wheezy. During the upgrade I also upgraded all other packages as well, including apache, php, and so on, and selected "yes" for overwriting config files with factory default ones. After this I fine-tuned my config files to have everything the way I like, but I did not find a way to fix this. Before the upgrade, the page displayed just fine.  Here is a screenshot, where you can see that Firefox sees the "charset=iso-8859-2" definition, but still displays the page with UTF-8 encoding.    My suspicion is, that this is a server configuration issue, but it could also be, that one part of the processing component (Apache, php) changed due to the upgrade in some way, resulting this strange behavior. The problem is, I can't pinpoint, what could possibly cause this problem.  Can anyone solve this mistery? What could be possibly going wrong during the processing of the page?
114879
It was hinted in a  that PHP can not reverse Unicode strings.      As for Unicode, it works in PHP   because most apps process it as   binary. Yes, PHP is 8-bit clean. Try   the equivalent of this in PHP: perl   -Mutf8 -e 'print scalar reverse("ほげほげ")' You will get garbage,   not "げほげほ". – jrockway   And unfortunately it is correct that PHPs unicode support atm is at best "lacking". This will .   PHPs  does provide the basic functionality you need to deal with unicode, but it is inconsistent and does lack a lot of functions. One of these is a function to reverse a string.  I of course wanted to reverse this text for no other reason then to figure out if it was possible. And I made a function to accomplish this enormous complex task of reversing this Unicode text, so you can relax a bit longer until PHP6.  Test code:  $enc = 'UTF-8'; $text = "ほげほげ"; $defaultEnc = mb_internal_encoding();  echo "Showing results with encoding $defaultEnc.\n\n";  $revNormal = strrev($text); $revInt = mb_strrev($text); $revEnc = mb_strrev($text, $enc);  echo "Original text is: $text .\n"; echo "Normal strrev output: " . $revNormal . ".\n"; echo "mb_strrev without encoding output: $revInt.\n"; echo "mb_strrev with encoding $enc output: $revEnc.\n";  if (mb_internal_encoding($enc)) {     echo "\nSetting internal encoding to $enc from $defaultEnc.\n\n";      $revNormal = strrev($text);     $revInt = mb_strrev($text);     $revEnc = mb_strrev($text, $enc);      echo "Original text is: $text .\n";     echo "Normal strrev output: " . $revNormal . ".\n";     echo "mb_strrev without encoding output: $revInt.\n";     echo "mb_strrev with encoding $enc output: $revEnc.\n";  } else {     echo "\nCould not set internal encoding to $enc!\n"; }
50605
How do I save user-entered line breaks from a &lt;textarea&gt; HTML element to a database?  It always removes the line breaks.
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?
99956
I get the following data from MySQL by db_query(). The type of the column is BLOB.     a:2:{s:10:"attributes";a:1:{s:5:"title";s:0:"";}s:8:"langcode";s:7:"zh-hans";}   How should I process it?
35886
Code is supposed to be exact and "as-is". Sometimes, showing two spaces is important. In a comment, it is not possible to show code with  multiple   spaces. This became apparent in  (see comments).  EDIT: apparently this bug is larger then I thought: multiple    spaces   here are neither preserved in normal question text. Pity (though I couldn't find this reported before, I'd assume it is).  Workaround: use Alt+0160 (windows), or U+00A0 (Unicode NBSP), as I did in the example above.
105397
I use some packages with require utf8. Here is the main file:  \documentclass[a4paper,titlepage]{report}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[american]{babel} \usepackage{csquotes} \usepackage[backend=biber,style=alphabetic]{biblatex} \addbibresource{refs.bib}  \begin{document} \nocite{*} \printbibliography[heading=bibintoc] \end{document}   And here is the reference file:  @MISC{Example,     author = {Author with spec\'{\i}al character},     title = {Title} }   I have no issues with composing special characters like \H{o} (ő) or \k{a} (ą). However, when I try to compose \'{\i} (í), I get the following inputenc error: "not set up for use with LaTeX". It seems like double compositions are not allowed. A solution is to use \'{i} instead, but not removing the dot is ugly. Surely there must be a better way?  Note: I have tried to add \DeclareUnicodeCharacter{00ED}{\'{\i}} to the preamble, but it doesn't help either.