title: Avoid MySql Omitting + sign while insert operation
body: <p>MySql Database and Tables and Columns holding <code>utf8_unicode_ci</code> collation. And this is how i am inserting a row in mysql table via core PHP :</p>
  
  <blockquote>
    <p>This is a core PHP code on server page file named getregister.php</p>
  </blockquote>
  
  <pre><code>$Insert = $con-&gt;query("INSERT INTO `USERS` (`ID`, `NAME`, `PHONE`, `CODE`) VALUES (NULL, '$NewUserName', '$NewUserMobile', '$UserCode')");
  if ($Insert === false)
  {
       echo "REPORT DEVELOPER EXCEPTION_CODE_7";
       exit();
  }
  else
  {
       echo "SUCCESS_NEW"; 
       exit();
  }
  </code></pre>
  
  <p>From the android device layouts <code>Edittext</code>, i am allowing end users, 0 to 9 with <code>+ Character too</code> : </p>
  
  <blockquote>
    <p>This is a native android code for edittext XML</p>
  </blockquote>
  
  <pre><code>&lt;EditText
          android:id="@+id/UserPhone"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/UserName"
          android:hint="NUMBER  HERE.."
          android:layout_marginBottom="15dp"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="2dp"
          app:met_iconPadding="0dp"
          app:met_iconRight="@drawable/ic_phone"
          app:met_minCharacters="10"
          app:met_maxCharacters="20"
          android:inputType="number"
          android:digits="0,1,2,3,4,5,6,7,8,9,+"
          android:textStyle="bold" /&gt;
  </code></pre>
  
  <p>And this is how i am opening connection to servers PHP page :</p>
  
  <blockquote>
    <p>This is a java code and appropriate java code to the layout</p>
  </blockquote>
  
  <pre><code>String urlParameters = "DEVICEID="+deviceid+"&amp;NAME="+name+"&amp;PHONE="+phone+"&amp;CODE="+code;
  URL url = new URL("https://example.com/getregister.php");
  connection = url.openConnection();
  connection.setDoOutput(true);
  
  OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
  
  writer.write(urlParameters);
  writer.flush();
  
  Log.d("GetRegistered : ", "OPENING : "+ url +" \n");
  
  InputStream is = null;
  is = connection.getInputStream();
  </code></pre>
  
  <p>Everything is working good as expected; but the problem is : </p>
  
  <ul>
  <li>If i enters mobile number as +919999999999</li>
  <li>It gets stored in MySql as WHITE_SPACE_919999999999 </li>
  <li>The + Sign is getting deleted and replaced by a whitespace either while inserting in MySql or from androids OpenConnection</li>
  </ul>
  
  <p>Thanks in advance, for reading, helping and giving your valuable time</p>
  
  <blockquote>
    <p>Edit : 2 </p>
  </blockquote>
  
  <p>As per the @jeroen given me hint about UTF8 encoding, i made some changes accordingly to the java code in android studio project to my http open url connection as follows : </p>
  
  <pre><code>URL url = new URL("https://www.example.com/getregister.php");
          HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
  
          connection.setRequestMethod("POST");
          connection.setDoInput(true);
          connection.setDoOutput(true);
  
          Uri.Builder builder = new Uri.Builder()
                  .appendQueryParameter("DEVICEID", deviceid)
                  .appendQueryParameter("NAME", name)
                  .appendQueryParameter("PHONE", phone)
                  .appendQueryParameter("CODE", code);
  
          String query = builder.build().getEncodedQuery();
  
          OutputStream os = connection.getOutputStream();
          BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
          writer.write(query);
          writer.flush();
          writer.close();
          os.close();
  
          connection.connect();
  </code></pre>
  
  <p>And now + character is getting stored in the MySql.</p>