I am working on an Auth/Login system, that does the following. JavaFX-App sends POST-Request to an &quot;auth.php&quot;, auth.php check if the user exists and returns a JSON with userdata. If my Database contains a character like &quot;Ü,Ä,ä,ö etc&quot; the method json_encode($data) fails. it returns nothing. Without one of those chars all works so fine. How I can get my code to working? &lt;?php     require &quot;config.php&quot;;     $username = &quot;&quot;;     $password = &quot;&quot;;     foreach($_POST as $keyname =&gt; $value){         switch($keyname){             case 'un':                 $username = $value;                 break;             case 'pw':                 $password = $value;                 break;             default:                 break;             }     }      $authuser = new AuthUser(false, -1, &quot;dummy&quot;, &quot;dummy&quot;, true);     $sql = &quot;SELECT `id`, `username`, `authkey`, `banned` FROM `users` WHERE `username`= ? AND `password` = ? LIMIT 1;&quot;;     $statement = $conn-&gt;prepare($sql);     $statement-&gt;bind_param('ss', $username, $password);     $statement-&gt;execute();     $result = $statement-&gt;get_result();     if($result-&gt;num_rows &gt; 0){         $data = $result-&gt;fetch_assoc();         $authuser = new AuthUser(true, $data['id'], $data['username'], $data['authkey'],  $data['banned'] ? true : false);     }  //Here it returns nothing if the data contains an &quot;ü,ö,Ä etc...&quot; it is like the json_encode cannot convert the user object containing special chars to an JSON String     echo json_encode($authuser);      class AuthUser{         var $auth = false;         var $id;         var $username;         var $authkey;         var $banned;         function __construct($auth, $id, $username, $authkey, $banned){             $this-&gt;auth = $auth;             $this-&gt;id = $id;             $this-&gt;username = $username;             $this-&gt;authkey = $authkey;             $this-&gt;banned = $banned;         }     } ?&gt;  Fixed by setting the mysqli connection encoding to UTF-8
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.
Identify geographic location to points I am quite new in QGIS and I really need your help.  I have a map of Kenya divided into 68 districts and I have coordinates of 30.000 schools. The points have one variable besides the latitude and longitude data called "distance to nearest school".   First I imported the map. Then I imported the spreedsheet and transformed it to a SHP file like the map. So now I have two SHP files.    The points have three variables: "Latitude", "Longitude" and "Distance to nearest school". I want to have a fourth variable called "District" and take the mean of the "Distance to nearest school" for each district. Create element in pdf that doesn't print to paper Cannot get grub menu to timeout (or go away) Left and right subscript / superscript I am trying to put two subscripts at the left and right of a character. For example, something like:  _{t} p_{x}  where p is in the middle. How do you do this? Print two files in two columns I want to print two files in two columns -- first file on the left side and second on the right side. paste doesn't do the job, because it can only insert a character as delimiter, so if first file lines have different length output will be twisted: $ cat file1 looooooooong line line $ cat file2 hello world $ paste file1 file2 looooooooong line   hello line    world  If it was a command to add trailing spaces like fmt --add-spaces --width 50 the problem would be solved: $ paste &lt;(fmt --add-spaces --width 50 file1) file2 looooooooong line                                 hello line                                              world  But I don't know a simple way to do this. So how to merge and print several files horizontally without twisting? Actually, I just want to look at them simultaneously.  UPD: command to add trailing spaces does exist (for example, xargs -d '\n' printf '%-50s\n') But solution like $ paste &lt;(add-trailing-spaces file1) file2  does not work as expected when file1 has fewer lines than file2. "Home page" or "homepage"? Is there a convention for the spelling of the name of the main page of a website? Should it be home page, with a space between the two words; or homepage, all one word? I've asked this question towards a developer for Minecraft and I thought I'd ask here too since they might not see the question.  How do I select all but two types of entities in Minecraft?  For example, something like: /say @e[type=![Player,Item],r=50] (to clarify I also tried type=Item,Player, type=Item,type=Player etc)  Should select any entity that does not match players or items, so things like Creepers, Ghasts, XPOrbs, PrimedTNT and so on within a radius of 50 blocks and print them to the chat.  Instead it ignores one of the flags, and works with the other instead. I need to find a bottleneck and need to accurately as possible measure time.  Is the following code snippet the best way to measure the performance?  DateTime startTime = DateTime.Now;  // Some execution process  DateTime endTime = DateTime.Now; TimeSpan totalTimeTaken = endTime.Subtract(startTime); How do I remove a malformed line from my sources.list? Install Java JDK and JRE on Debian 8 I installed Debian 8, I would like to install Java JRE and JDK. I use  and it works.  But, I am afraid because it's a script hosted in a repository. I would like to understand why it doesn't work when I put the extract of  in /usr/java/jre1.8.0_73 directory as . I added the path variable with PATH=/usr/local/jdk1.8.0/bin:$PATH export PATH as explained in  but it doesn't work.  Even if I try to install OpenJDK, the package isn't found. I don't understand why it's so complicated to install Java on Debian; it is very simple on Ubuntu. I would like someone give me step-by-step instructions to install it. Why do I get 'UnknownHostException: session.minecraft.net' when attempting to log in to Minecraft servers? Haar Measure on Semidirect Product of Unimodular Groups Let $M, N$ be closed subgroups of a given locally compact topological group such that the product $P = MN$ is semidirect, with $M$ normalizing $N$.  Assume second countable, sigma compact, whatever so that Radon products coincide with product measures.  To make life easy, assume $M, N$ are unimodular.  How do we construct a Haar measure on $P$? Change how questions marked as duplicates by the asker are represented Situation: when a user self-marks their post as a duplicate, it shows as closed by "community" rather than the original poster.  Problems: this is not clear at all to most users of SE what has happened. It looks like the question was "mod closed" as a duplicate against the asker's wishes.    Suggestion: instead of the community user "closing" the post, have the final close user be the asker (or make it "Community &amp; Asker"). This will help clear up confusion and streamline the process for understanding what happens. .NET Casting Generic List When should a verb be followed by a gerund instead of an infinitive? Real-life examples of common distributions If you go to review a suggested edit and close the Reject dialogue box, the button at the top-right will continue to say "Rejecting...". You will not be able to continue with the review process.  I have refreshed the page, and tried clearing my cache. If I refresh the page, I can continue reviewing the edit.  I'm using Chrome Version 31.0.1650.57 m. What does = +_ mean in JavaScript I'm having a lot of trouble figuring this one out.  Determine if  $\sum_{i=2}^{\infty} \frac{(-1)^n}{n+(-1)^n}$ converges or diverges  Both ratio and root test are inconclusive and I'm at a loss. Can anyone help me? Receiving Stack Overflow's Chat Notification This is regarding the feature where we can chat regarding a question on SO. There is an automated process for creating the room from comments. It's a very useful feature in case the OP is not able to understand an answer and needs more clarification.  What I don't see is a notification system for chats where there has been an extended period of time between communication.   Let's say someone replied to my chat after a few days, in that case I do not receive any notification.   This happened to me only a few hours ago, where in I had replied to one question but the OP was not available at that point and he replied to me after some days. As I didn't check that chat I had no way of noticing if someone replied to my message and the 48h window after my last activity in that chat, during which I would have received the @ convention ping notification, had already expired.  We receive notification on posts, upvotes that we receive, so why not the chat rooms?   Should there be a notification center like the one for posts (or may be include this in the same center as posts)?