I have french words stored in database,however while displaying in browser the characters are not properly displayed,displays like � and so on..How convert such word exactly to french words same as entered in database using PHP ? I have tried html_entity_decode(),works for some of the cases.
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.
Python Referenced For Loop Unbiased estimator for geometric distribution parameter p Sqrt disappeared when exporting plot to PDF in version 10 How come if $\ i\ $ not of the following form, then $12i + 5$ must be prime? I know if $\ i\ $  of the following form $\ 3x^2 + (6y-3)x - y\ $ or $\ 3x^2 + (6y-3)x + y - 1, \ \ x,y \in \mathbb{Z}^{+},i \in \mathbb Z_{\ge 0}$,  then $\ 12i + 5\ $ must be composite number, because:  $12(3x^2 + (6y-3)x + y - 1) + 5 = 36x^2 + (72y - 36)x + (12y - 7) = (6x + 12y - 7)(6x  + 1)$  How come if $\ i\ $ not of the following form $\ 3x^2 + (6y-3)x - y\ $ and $\ 3x^2 + (6y-3)x + y - 1\ $,  then $12i + 5$ must be prime? $\ x,y \in \mathbb{Z}^{+},i \in \mathbb Z_{\ge 0}$.  For example: $\ 5 = \ 3*1^2 + (6*1-3)*1 - 1\ $ ,when $\ x = y = 1\ $, as proved before,$\ 5*12+5\ $ must be composite number;  $\ 0, \ 1. \ 2.\ 3.\ 4\ $ can't of the following form $\ 3x^2 + (6y-3)x - y\ $ and $\ 3x^2 + (6y-3)x + y - 1\ $,  $\ 12*0 + 5 = 5\ $, $\ 5 $ is prime,$\ 12*1 + 5 = 17\ $, $\ 17 $ is prime, and so on, How to add upload field in a custom taxonomy? Square version of \cdot (small black square)? I'm looking for the symbol that's similar to \cdot in math mode, but instead of a small circle, it's a square. Like this: How to completely remove desktop? I wanted to switch to Xfce (I had KDE and GNOME installed), and I did this :    sudo apt-get install xubuntu-desktop sudo apt-get remove kubuntu-desktop sudo apt-get remove ubuntu-desktop sudo apt-get autoremove   but to my surprise, I could still pick gnome, kde plasma, etc during the log in.  So, how do I completely remove KDE and GNOME desktops? How to disable Import option in LibreOffice Calc while pasting text in a cell? I'm making a table in which I have to copy few lines from pdf to a table. I'm using LibreOffice calc for table making purpose. Problem is that even though I am copying simple text from the pdf, when I paste it to LibreOffice, Import Option keeps on poping up(randomly-sometimes it pop up sometime it does't). And due to this pasted text's font size also very small. Desired result is that when I paste the text in the cell, it just got pasted in the cell, without any time wasting popup which also disturbs the font size. Same question is asked here but no solution. I would like to convert tab to spaces in gVim. I added the following line to my _vimrc:  set tabstop=2   It works to stop at two spaces but it still looks like one tab key is inserted (I tried to use the h key to count spaces afterwards).  I'm not sure what should I do to make gVim convert tabs to spaces? Is a sentence always grammatically incorrect if it has no verb? Is the following grammatically correct? My friend says the second sentence is grammatically incorrect, but couldn't explain why.     I have always been fascinated by statistics. The different ways in   which you could look at data and infer knowledge from it. Selecting through one-to-many relationship I'm trying to make a species distribution project where I can select a species from a non-spatial list of species and the selection would highlight (select) all the counties to which the species has been attributed.  Simplified example data: species, a non-spatial table of species (CSV with header): "species" "Mus borealis" "Mus australis"  species_distributions, a non-spatial relation table (csv with header): "species","county" "Mus borealis","North" "Mus borealis","Central" "Mus australis","South" "Mus australis","Central"  counties, a spatial feature class representing county boundaries (first row = field name): "county" "North" "South" "Central" "West"  So if I select "Mus borealis" from the species table, the "North" and "Central" counties would be highlighted in the map. Seems like a simple scenario, but I have been unable to uncover a solution on my own. The closest I've found is a plugin "Select by relationship" but it doesn't appear to be available for QGIS 3 (I'm using QGIS 3.4.3). I have a PostGIS server available. Java: How to find if a method is overridden from base class? What is this yellow and white mass inside my red cabbage? Is "Don't do it" a valid answer? If someone asks how to do XYZ, and you think doing XYZ at all is a Bad Idea™, is it valid to post an answer saying so? You aren't answering the question, but instead, arguing the question's validity.  You could do this in a comment, but I don't think comments carry enough weight on occasion.  For example, I came across this today ; for those not wanting to link away:     I would like to build a wiki based website about professors, so that students can share information and check the reputation of the professor before working for him.   and I really wanted to post an answer that said, "I think this is a very bad idea". (In fact I did anyway, despite awareness that it could get myself flamed.)  Was I wrong? What should I have done instead? Does Stack Exchange use caching and if so, how? Characterizing all ring homomorphisms $C[0,1]\to\mathbb{R}$. This is something I've been trying to work out this evening.      Let $R$ be the ring of continuous real-valued functions on $[0,1]$ with pointwise addition and multiplication. For $t\in [0,1]$, the map $\phi_t\colon f\to f(t)$ is a ring homomorphism of $R$ to $\mathbb{R}$. I'm trying to show that every ring homomorphism of $R\to\mathbb{R}$ has this form.   Suppose otherwise, that there is some $\phi\neq\phi_t$, and thus there is some $f_t\in R$ such that $\phi(f_t)\neq \phi_t(f_t)=f_t(t)$. Define $g_t=f_t-\phi(f_t)1\in R$. Here $\phi(f_t)1$ is the constant function sending $[0,1]$ to $\phi(f_t)$. Then $g_t(t)\neq 0$. My first small question is why does $\phi(g_t)=0$? It seems only that $\phi(g_t)=\phi(f_t)-\phi(\phi(f_t)1)$.  I would like to conclude that there are only finitely many $t_i$ such that $g(x)=\sum g_{t_i}^2(x)\neq 0$ for all $x$. Then $g^{-1}=1/g(x)\in R$, but $\phi(g)=0$, contradicting the fact that homomorphisms map units to units. How can we be sure there are only finitely many $g_{t_i}$ such that the sum of their squares is never $0$? Thanks. Assume you have a flat table that stores an ordered tree hierarchy:  Id   Name         ParentId   Order  1   'Node 1'            0      10  2   'Node 1.1'          1      10  3   'Node 2'            0      20  4   'Node 1.1.1'        2      10  5   'Node 2.1'          3      10  6   'Node 1.2'          1      20   Here's a diagram, where we have [id] Name.  Root node 0 is fictional.                          [0] ROOT                           /    \                [1] Node 1          [3] Node 2               /       \                   \     [2] Node 1.1     [6] Node 1.2      [5] Node 2.1           /            [4] Node 1.1.1   What minimalistic approach would you use to output that to HTML (or text, for that matter) as a correctly ordered, correctly indented tree?   Assume further you only have basic data structures (arrays and hashmaps), no fancy objects with parent/children references, no ORM, no framework, just your two hands. The table is represented as a result set, which can be accessed randomly.   Pseudo code or plain English is okay, this is purely a conceptional question.  Bonus question: Is there a fundamentally better way to store a tree structure like this in a RDBMS?    EDITS AND ADDITIONS  To answer one commenter's ('s) question: A root node is not necessary, because it is never going to be displayed anyway. ParentId = 0 is the convention to express "these are top level". The Order column defines how nodes with the same parent are going to be sorted.  The "result set" I spoke of can be pictured as an array of hashmaps (to stay in that terminology). For my example was meant to be already there. Some answers go the extra mile and construct it first, but thats okay.  The tree can be arbitrarily deep. Each node can have N children. I did not exactly have a "millions of entries" tree in mind, though.  Don't mistake my choice of node naming ('Node 1.1.1') for something to rely on. The nodes could equally well be called 'Frank' or 'Bob', no naming structure is implied, this was merely to make it readable.  I have posted my own solution so you guys can pull it to pieces. Update (March, 2012): This has been rolled out to all sites in the network.    Behind the scenes we've been hard at work making some changes to how we track reputation.  Here are some of the issues we're aiming to address with these changes:   Reputation Skew (your actual reputation doesn't match what's shown) Up/Down votes oddities (mostly with the daily rep cap, the magical +2) Historical Deletes (not impacting rep immediately, contributing to skew) Unaccepts (display issues in the profile) User Deletion (magically missing rep, another skew contributor)   To be clear: reputation values are not changing, every action in the system is still worth the same amount.   Here’s what will be different:   Your reputation will be correct at all times Deletions will have a much more immediate effect on reputation, not waiting on a recalc  (but reputation sync takes up to 5 minutes on a delete/undelete action; as to not block the user's response thread, it's offloaded to a background queue) Recalcs will no longer be necessary Up/Down vote reversals will restore the correct reputation amount Up/Down vote reversals will correctly adjust to the reputation cap The reputation history in your profile will be more detailed and accurate (e.g. when a post is deleted, you'll see that in the reputation tab of your profile)   This means your reputation will go up and down more than it has previously, but it will be in sync.  To think of it more easily: imagine that a recalc will be done after every action in the system.  Probably the biggest impact many will be concerned with is that you may see your reputation drop in cases where it didn't seem like it did before  This was effectively happening before, but the results of that change were not applied immediately, but on the next rep recalc.  Post deletion is the biggest factor here, previously it didn't (immediately) account for the reputation impact...that will no longer be the case.  Reputation changes from the deletion will now be applied within the hour, and most other changes will be instant.  Now the part that will make everyone throw vegetables our way:  this will require a global recalc to get everything in sync.  We'll be rolling it out first here on meta, then the rest of the network...the enabling of the detailed rep view and global recalc on each individual site will coincide.  During the rollout you will see empty reputation tabs on profiles as we transition to the new storage behind the scenes, they'll be restored as the recalc rolls though each user.  We’ll put up a blog post on  before the network-wide rollout.  If you have any questions about this change or details I may have left out, please do so in answers below so that we can clear up as much as possible before this rolls out. Is there a word for two persons dodging each other on the street? Razr Maxx HD, How to wipe data with broken screen My screen is totally destroyed, it's black and unresponsive. The phone turns on just fine, though. I just got my new phone and I have to send this one back now.  I want to wipe the phone before I send it back, but I'm not sure how. I don't care too much about sending back a rooted phone, it seems Asurion doesn't really care about that from what I've read, but I don't want my personal data on the phone when I send it in.  What are my options to wipe the phone without a screen? I've already read a lot of threads on other forums and here on the subject, but everyone seems to say to wipe through ADB shell. Well, I can see the phone in ADB, but I am unable to enter SU through ADB shell. I assume it's because the screen is locked, and I have no way to unlock it. Others have also said to wipe through fastboot in ADB, but I am seeing conflicting recommendations and I'm not sure how to proceed. I'm not that proficient with ABD, so I want to make sure I don't mess this up.  Any advice would be greatly appreciated.