I have A problem in my PHP Side of my Application. The Arabic Words Shown Correctly in phpmyAdmin but when i make POST request i got this response :  [{"sno":"1","post_author":"authoromar","post_title":"titleomar","post_body":"bodyomar","post_breaking":"breaking omar","created_at":"0000-00-00 00:00:00","photo_url":"","photo_title":""},{"sno":"2","post_author":"authorrrrrrr","post_title":"titllllll","post_body":"bodyyyyyyyy","post_breaking":"breakinggggggg","created_at":"2016-08-10 12:22:47","photo_url":"","photo_title":""},{"sno":"3","post_author":"\u0639\u0645\u0631","post_title":"\u0627\u0644\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0631\u0626\u064a\u0633\u064a","post_body":"\u0645\u062d\u062a\u0648\u0649 \u0627\u0644\u062e\u0628\u0631","post_breaking":"\u0639\u0627\u062c\u0644 \u0639\u0627\u0627\u0627\u0627\u0627\u0627\u0627\u0627\u0627\u0627\u062c\u0644","created_at":"2016-08-15 16:41:29","photo_url":"http:\/\/hjhjhjhjh","photo_title":"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0635\u0648\u0631\u0629"},{"sno":"4","post_author":"\u062a\u0627\u062a\u0644\u0627\u062a\u0644\u0627\u062a\u0628\u0644\u0627\u0628\u0644\u0627\u0628\u0644\u0628\u0644\u0628\u0644","post_title":"\u0627\u062a\u0644\u0627\u062a\u0644\u062a\u0627\u0644\u0627\u062a\u0644\u0627\u062a\u062a\u0644\u0627\u0644\u0644\u062a\u062a\u0644","post_body":"\u0644\u0627\u0628\u0644\u0627\u0628\u0644\u0627\u0628\u0644\u0628\u0628\u0627\u0628\u0644\u0627\u0644\u0628","post_breaking":"\u062b\u0641\u0642\u062b\u0641\u0642\u062b\u0641\u0642\u062b\u0642\u062b\u0642\u062b","created_at":"2016-08-15 16:58:08","photo_url":"khjhjkhj","photo_title":"fgfhgfhffhfh"},{"sno":"5","post_author":"\u0633\u064a\u0634\u064a\u0634\u0633\u0634\u064a\u064a\u0633\u0634\u0633\u064a\u0634\u064a","post_title":"\u0634\u064a\u0633\u0634\u064a\u0633\u0634\u0633\u0634\u064a\u0633","post_body":"\u0628\u0633\u0628\u0633\u0644\u0644\u0644\u0627\u0627\u0633\u0627\u0633","post_breaking":"\u062a\u062a\u0627\u0627\u062a\u0627\u0644\u0628\u0644\u0628\u0644\u0628\u0644\u0628","created_at":"2016-08-15 17:05:19","photo_url":"llkjkjjkljkkjkjkjkj","photo_title":"rsdsdsddsffsdsdf"},{"sno":"6","post_author":"\u0645\u0643\u0646\u0645\u0643\u0646\u0645\u0646\u062a\u0645\u062a\u0646\u0645\u0646\u062a","post_title":"\u062d\u062e\u0633\u062b\u062d\u0647\u062e\u0644\u0641\u062a\u062b\u0633\u0647\u0641\u062a\u0639","post_body":"\u0645\u062b\u0635\u062a\u0641\u0645\u0646\u062b\u0635\u062a\u0645\u0627\u062a","post_breaking":"\u064a\u062a\u0633\u0644\u0645\u0646\u062a\u0633\u064a\u0644","created_at":"2016-08-15 17:26:26","photo_url":"\u0643\u0628\u064a\u0627\u0646\u0629\u0645\u0643\u064a\u0628\u0646\u0627\u0643\u0645\u0628\u064a\u0646","photo_title":"\u0643\u0646\u062d\u062e\u0628\u0647\u0642\u0647\u063a\u062e\u062d\u0647\u062b\u063a"}]   this is my PHP File :  &lt;?php header("Content-Type:application/json;charset=utf-8"); $mysql_db_hostname = "127.0.0.1"; $mysql_db_user = "root"; $mysql_db_password = ""; $mysql_db_database = "testdb";  $con = @mysqli_connect($mysql_db_hostname, $mysql_db_user, $mysql_db_password,  $mysql_db_database); $con-&gt;set_charset("utf8"); //$con-&gt;query("SET collation_connection = utf8_unicode_ci"); if (!$con) {  trigger_error('Could not connect to MySQL: ' . mysqli_connect_error()); } $var = array(); $sql = "SELECT * FROM posts"; $result = mysqli_query($con, $sql);  while($obj = mysqli_fetch_object($result)) { $var[] = $obj; } print json_encode($var); ?&gt;   what i want is to show arabic words like بسم الله instead of \u064a\u0633\u0634\u0633\u064a\
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.
Dealing with rust on a steel frame On Windows 10 Professional, with the November update (Build 10586, Version 1511) , is there any possibility to completely remove Windows Defender ?  I don't want to just disable Windows Defender.  I want to completely uninstall from my system. PostgreSQL crash when connection failed Error log is:  016-02-21 21:22:34 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" .... .... 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET LOG:  CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall.       (error code 299) 2016-02-21 21:22:37 GET LOG:  could not fork new process for connection: No error 2016-02-21 21:22:37 GET LOG:  incomplete startup packet 2016-02-21 21:22:38 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:38 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:42 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:42 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:24:26 GET LOG:  could not receive data from client: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. 2016-02-21 21:24:26 GET LOG:  incomplete startup packet 2016-02-21 21:24:29 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:24:45 GET PANIC:  could not write to log file 000000010000000100000041 at offset 4259840, length 8192: Invalid argument 2016-02-21 21:24:45 GET STATEMENT:  COMMIT 2016-02-21 21:24:53 GET LOG:  server process (PID 470944) was terminated by exception 0xC0000409 2016-02-21 21:24:53 GET DETAIL:  Failed process was running: COMMIT 2016-02-21 21:24:53 GET HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value. 2016-02-21 21:24:53 GET LOG:  terminating any other active server processes   Can anyone help to solve the problem? I spent many hours but didn't find a solution.   Postgres version 9.4 Operating System: Windows  postgresql.conf is:  listen_addresses = '*' port = 5432  max_connections = 100 shared_buffers = 128MB   dynamic_shared_memory_type = windows   pg_hba.conf is:  # IPv4 local connections: host    all             all             127.0.0.1/32            md5 host    all             all             0.0.0.0/0               md5 Documents required by Indian citizens wishing to travel to Nepal I'm a citizen of India and I'm travelling to Nepal by air. Is an Aadhaar Card a valid document used for travelling to Nepal by air? Basic circuit to keep LED either on or off depending on night/day How can I have a LED either on or off (not in between) depending on night or day with basic electronics? I have created the circuit below, but it only shines and in darkness it dims.    The photo-resistor is about 3kΩ when light shines and about 1MΩ when dark.  I want my LED to shine at night and be off at day.  What is the simplest way I can achieve this? How to get permission number by string : -rw-r--r-- I need to set the same chmod, how to get number for -rw-r--r-- ? Which JDK version is compatible with Netbeans on Ubuntu? I'm trying to install Netbeans on my Ubuntu. It was successfully installed but was unable to create new projects or new files. I have installed JDK 12 and then I removed it because I found here a solution that recommended removal of latest versions of JDK and set JDK 8 as default. I did what solution said but now I can't install JDK 8. It is showing me this error message:   E: Package 'oracle-java8-installer' has no installation candidate    So I started searching on the Internet about the solution and I found that "Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)".   What should I do now? Joining lots of small polygons to form larger polygon using PostGIS? I have a batch file which I use to create an .apk file on my Windows machine. Now I need to be able to create the .apk file in Ubuntu but I don't know how translate my .bat file to a script to be able to run it on Ubuntu.  Below is the batch file which works fine on Windows.  Will you please give me some hints on how I can run it on Ubuntu?  @echo off set PAUSE_ERRORS=0 :user_configuration  :: Path to Flex SDK  set FLEX_SDK=C:\sdk\flex_sdk_4.5.1.21328  :: Path to Android SDK set ANDROID_SDK=C:\sdk\android  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :flexsdk echo. echo ERROR: incorrect path to Flex SDK echo. if %PAUSE_ERRORS%==1 pause exit  :androidsdk echo. echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat' echo.  if %PAUSE_ERRORS%==1 pause exit  :succeed set PATH=%PATH%;%FLEX_SDK%\bin set PATH=%PATH%;%ANDROID_SDK%\platform-tools  :: Android packaging set AND_CERT_NAME="PeymanApp" set AND_CERT_PASS=fd set AND_CERT_FILE=cert\SampleApp.p12 set AND_ICONS=icons/android  set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass     %AND_CERT_PASS%  :: Application descriptor set APP_XML=application.xml  :: Files to package set APP_DIR=bin set FILE_OR_DIR=-C %APP_DIR% .  :: Your application ID (must match &lt;id&gt; of Application descriptor) set APP_ID=air.com.doitflash.SampleApp  :: Output packages set DIST_PATH=dist set DIST_NAME=PeymanApp  :validation %SystemRoot%\System32\find /C "&lt;id&gt;%APP_ID%&lt;/id&gt;" "%APP_XML%" &gt; NUL if errorlevel 1 goto badid goto end_validation  :badid echo. echo ERROR: Application ID (APP_ID) does NOT match Application descriptor '%APP_XML%'     (id)  echo.  :end_validation  set TARGET= set PLATFORM=android  ::call bat\Packager.bat if "%PLATFORM%"=="android" goto android-config  :android-config set CERT_FILE=%AND_CERT_FILE% set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS% set ICONS=%AND_ICONS% set DIST_EXT=apk set TYPE=apk goto start  :start if not exist "%CERT_FILE%" goto certificate :: Output file set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" . if not exist "%DIST_PATH%" md "%DIST_PATH%" set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT% :: Package  echo true echo. call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%"     "%APP_XML%" %FILE_OR_DIR% -extdir lib/ echo. if errorlevel 1 goto failed goto end  :certificate echo Certificate not found: %CERT_FILE% echo.  if %PAUSE_ERRORS%==1 pause exit  :failed echo APK setup creation FAILED.  if %PAUSE_ERRORS%==1 pause exit  :end We have noticed that when using nginx internal 301 and 302 handling, nginx will serve a small document body with the appropriate Location: ... header.  Something along the lines of (in html): 301 redirect - nginx.  As appropriate in the above behaviour, a content-type text/html and content-length header is also sent.  We do a lot of 302 and some 301 redirects, the above behaviour is wasted bandwidth in our opinion.  Any way to disable this behaviour?  One idea that crossed our mind was to set error_page 301 302 to an empty text file. We have not tested this yet, but I am assuming even with the above, the content-type and content-length (0) headers will be sent.  So, is there a clean way to send a "body-less" 301/302 redirect with nginx? How can I set default terminal used in Unity? How can I set the default terminal used in Unity?  I would like to use the Ctrl+Alt+T hotkey to start a non-default terminal. The default terminal is gnome-terminal.   Where can I change the default terminal value? Which is the correct way to tell where I'm working?        I'm working in XYZ company.   I'm working for XYZ company.   I'm working at XYZ company.      Or is there any difference in the meaning? I'm using custom post types, but they don't appear on tag pages along with regular posts and i'd like to include both standard and custom post types on tag or category pages. What would be required before the loop to include all posts? (including custom type). Updated: To add, I found this code , which worked perfectly for the first part: add_filter('pre_get_posts', 'query_post_type'); function query_post_type($query) {   if ( is_category() || is_tag() &amp;&amp; empty( $query-&gt;query_vars['suppress_filters'] ) ) {     $post_type = get_query_var('post_type');     if($post_type)         $post_type = $post_type;     else         $post_type = array('post','cpt'); // replace cpt to your custom post type     $query-&gt;set('post_type',$post_type);     return $query;     } }  Second question still remains though: Is there a way to allow readers to filter by post type? So either of the following would work..  example.com/tag/blue?post_type=custom example.com/tag/blue?post_type=post Prove if $ p$ is a prime of the form $3n+1$, then $p$ is also of the form $6m+1$ Prove that if $p$ is a prime of the form $3n+1$, $p$ is also of the form $6m+1$.  I guess one could use the division algorithm for this; but, what's the best method? Geometric random variables $X_1:G(p_1)$ $X_2:G(p_2)$ $X_3:G(p_3)$ are independent, prove the following : What is $\sqrt{i}$? If $i=\sqrt{-1}$, is $\large\sqrt{i}$ imaginary?     Is it used or considered often in mathematics? How is it notated? Does a conducting wire give off measurable radiation? Posts linked in deleted answers still show up under "Linked" E.g. see . Why $SU(3)$ and not $U(3)$? "method driver /usr/lib/apt/methods/https could not be found" update error sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found. michael@Ubuntu:~$ sudo apt-get clean michael@Ubuntu:~$ cd /var/lib/apt michael@Ubuntu:/var/lib/apt$ sudo mv lists lists.old michael@Ubuntu:/var/lib/apt$ sudo mkdir -p lists/partial michael@Ubuntu:/var/lib/apt$ sudo apt-get clean michael@Ubuntu:/var/lib/apt$ sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found. E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? michael@Ubuntu:/var/lib/apt$ sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found.   Why am I getting these errors when doing an apt-get update?