I have a Netherlands texts saved in my table. They show well in MySQL table like this Wilt u hoogstens één of twee kinderen, ook al kunt u zich qua gezondheid en inkomen meer kinderen permitte When I select that text and do an echo with PHP I get Wilt u hoogstens ��n of twee kinderen, ook al kunt u zich qua gezondheid en inkomen meer kinderen permitte. I tried to set the PHP page to use &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt; and also tried to do echo utf8_decode($text) but the text is still not showing as in the table. Any help on this please? Thanks. Note: the table field collation where the text is stored is utf8mb4_general_ci To select the text from my table I'm using PHP PDO: function get_questions($userBrowserLanguage, $dbh) { $query = &quot;SELECT Frage, FrageNr FROM `tbl_fragen` WHERE Language = ? AND Test = ? AND Frage != ? ORDER BY FrageNr ASC&quot;;     $parameters = array('nl', 'OCA55', '');//$userBrowserLanguage     $sth = do_query($query, $parameters, $dbh);     $questions = array();     while ($question = do_fetch_result($sth)) {         array_push($questions, array($question['FrageNr'], $question['Frage']));     }     return $questions; }
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.
21088
i'm trying to create a multilingual node using a php script.  I'm doing this:   $node = new stdClass();  $node-&gt;title = "Test ".mktime();  $node-&gt;type = "job";  $node-&gt;language = 'de'; // Or e.g. 'en' if locale is enabled  $node-&gt;uid = $user-&gt;uid;   $node-&gt;status = 1; //(1 or 0): published or not  $node-&gt;promote = 0; //(1 or 0): promoted to front page  $node-&gt;comment = 1; //2 = comments on, 1 = comments off  $node-&gt;path = array('alias' =&gt; 'das-ist-ein-test-'.mktime());  $node-&gt;body[$node-&gt;language][0]['value']   = "Body Body Body";  $node-&gt;body[$node-&gt;language] = text_summary("Body Body Body");  $node-&gt;body[$node-&gt;language]  = 'filtered_html';  node_save($node);   As long as i set $node->language to 'und' everything is working fine. But as soon as I set the language to 'de' or 'en' (both languages are activated in my Drupal installation) the body text doesn't get saved.  So my question is: can anybody provide me with a working example of how to store a multlingual node (de,en) into Drupal using program code.  Thank you
21770
Run the following SEDE query: . All the tags except kyūjitai-and-shinjitai, renyōkei, あれ, and たい-form get auto-linkified. These happen to also be the only four tags that contain characters outside the standard set of allowed characters [a-z 0-9 + # - .]. It would be nice if these would auto-linkify too. (I imagine this is even more applicable for other language sites like  - if you , you find that well over half the tags don't linkify because they contain Cyrillic characters.)
10256
How do I use the json_encode() function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object?
99906
One of the responses to  suggested that I should make sure my database can handle UTF-8 characters correctly. How I can do this with MySQL?
62666
This is with ref to my previous question .  \documentclass[11pt,table,a4paper]{article} \usepackage{lmodern} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage{CJKutf8} \usepackage[english,russian]{babel}  \newenvironment{SChinese}{%  \CJKfamily{gbsn}%  \CJKtilde  \CJKnospace}{}   \begin{document}  \selectlanguage{russian}   Это мой первый многоязычный докладе.   Инфантильный гипертрофический стеноз привратника - это серьёзное   \selectlanguage{english}   This is my first multilingual report.   \begin{CJK}{UTF8}{}   \begin{SChinese}     这是我的第一个多语种的报告。   \end{SChinese}   \end{CJK}    \end{document}   when I try to compile it, I get following error message.  LaTeX Warning: Unused global option(s):     [table].  (./data.aux (/usr/local/texlive/2011/texmf-dist/tex/latex/cyrillic/t2acmr.fd)) (/usr/local/texlive/2011/texmf-dist/tex/latex/lm/t1lmr.fd)  LaTeX Font Warning: Font shape `T2A/lmr/m/n' undefined (Font)          using `T2A/cmr/m/n' instead on input line 15.   ! Package inputenc Error: Unicode char \u8:  not set up for use with LaTeX.  See the inputenc package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                      l.18 ...�ный гипертрофический стеноз привра...   How can I avoid such error message.
104321
The international Stack Overflow sites in Spanish, Portuguese, Russian, and Japanese seem to have a bug in their quick site descriptions (under their titles), for they all start with the word  For...  in English, instead of their respective languages As an example, the Spanish Stack Overflow site description is:  For programadores y profesionales de la informática  Obviously, this isn't something too big of a deal, but since they offer those sites in their respective languages, it would be nice if this issue were fixed. You can see this under &quot;More communities&quot; in the top bar.    You can also see this on the  page, where the descriptions begin with  Q&amp;A for...
64966
I have a multilingual PHP site. I have set English as the default language.  The language changes automatically according to the browser settings. If it is French, the site will be seen in French.  However in the Google search results, even if I have the browser in French, the English language appears in the results. How can I fix that?  To be clear I don't want to use subdomains or URLs like www.example.com/fr/. I would like it to work like Facebook.
213
Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh-&gt;prepare('SELECT * FROM :table WHERE 1'); if ($stmt-&gt;execute(array(':table' =&gt; 'users'))) {     var_dump($stmt-&gt;fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"
37749
I am working on a project involving cards from the Magic: The Gathering game. To be of any use, I must load the basic information about each card into my database, but some of the fields may contain arrays of text, that is, they may contain multiple values .  For example, a card can be classified to be both "green" and "blue". Or it can have several different creature types specified, and so on.  My first thought was to simply store the values as a string, and then search using the LIKE keyword. In combination with the NOT keyword, it should be possible to search for any desired combination of words, and also exclude certain words.   However, LIKE is going to be (relatively) slow as it can't use an index and has to rely on text pattern matching, and probably has other drawbacks as well. With normalization I could improve speed by assigning an integer key to each keyword, and then create a table that connects each card with the relevant keys (see  for a clearer description).  But with normalized tables I have to deals with joins (severely increased code complexity, not only in the SQL part), transactions (to update all relevant tables or rollback everything), and possibly decreased performance due to joins (see ).  AFAIK there are roughly 20000-25000 different magic cards in existence (and more being released every year). With one row for each card, is it worth it overall to normalize the data, or is the benefit not worth the costs? Why/Why not? And how do you decide this question in general?  EDIT: I am currently using a MySQL database, but I would also appreciate answers that apply to any of the other non-commercial/open source databases out there. Who knows - I might switch to a different database at some point.  Answers should not provide a technical solution only, but explain why it would/might be the right solution in terms of best/good enough performance for least amount of effort.
27341
Is there an easy way of getting the charset and collation of the DB tables in WordPress without resorting to SQL queries?
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}
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?
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.
53187
How can I set my database to see the 'date' as "MDY" without running:  SET datestyle = "ISO, MDY";   every-time I'm trying to access it? I'm using Postgresql version 9.1, Ubuntu 12.04. My system locale, at the time of the database installation was set to en_CA.utf8 and I recently changed it to en_US.utf8.  show lc_CTYPE   returns: --> "en_CA.UTF-8"  but  show LC_CoLLATE   returns: --> "en_CA.UTF-8"
49879
Currently when you search for a combination of tags in localized Stack Overflow you get some text in English. For example in Stack Overflow en español:       Etiquetadas con [python] or [php]        Etiquetadas con [python-3.x] not [python] not [bla]   Same in SOru:     С метками: [python-3.x] not [python] not [bla]   Looking for the text in traducir.win I could not find it, so I assume it is somehow hardcoded. Could you include it in Transifex?
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().