0

When I send an SMS text message from send-mail.php to a 4G phone the percent sign changes to an upside down question mark. It works fine sending to a 3G phone. The message is about probability of rainfall, for example "10% chance of rain".

<?php 
   // Phone number to send to 
   $phone2send2 = '1231234567@vtext.com'; 
   $headers = "From:" . $from; 
   $strForecast = "10% chance of rain"; 
   $body = $strForecast; 
   if (mail($phone2send2, $subject, $strForecast, $headers, "-f me@me.com")) { } else { }        
?>
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
user1892770
  • 323
  • 2
  • 3
  • 15

1 Answers1

0

I suspect your phone is attempting to parse the string as UTF-8. Somewhere, the encoding is getting confused. Try using the utf8_encode() method:

$strForecast = utf8_encode("10% chance of rain"); 
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
  • Thanks! I wasn't sure how to specify the encoding, your string is very helpful. I will run some tests and reply when I find out if this is working. I might take a few days to contact the person with the problem receiving the message correctly on his phone, but I will reply back with results. Is utf8 best, or should I use ascii? – user1892770 May 02 '14 at 16:45