<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Boa tarde, pessoal.<div><br></div><div>Estou conseguindo enviar mensagem de texto (sms) usando um servidor Asterisk e placa Khomp.</div><div>O problema é que a acentuação não funciona.</div><div>Já troquei os caractéres acentuados por não acentuados.</div><div>O caso é que, quando se usa o $ (cifrão), este é trocado por um caractere diferente e, se o número estiver colado nele, este é apagado.</div><div><br></div><div>Exemplo:</div><div>R$ 30,00 -&gt; fica R?30,00 e se for R$30,00 fica R,00 (aproximadamente).</div><div>Mais uma coisa estranha: depois que consegui mudar o código para que os caracteres acentuados ejam trocados pelos não acentuados e o $ funciona, nos telefones com sistema Android Lolipop ou nos Iphone com Ios versão 6, o $ (cifrão) continua com problemas.</div><div><br></div><div>Alguém conhece uma biblioteca para php que funcione?</div><div>Obrigado.</div><div><br></div><div>O meu código ficou assim:</div><div><br></div><div><div><span style="font-size: 12pt;">$receivedmensagem</span>= "teste com R$ 12,00 às 16h";</div></div><div><br></div><div><div>$smsmensagem2 = str_replace("R$", "R$ ", $smsmensagem2); &nbsp;// Coloca um espaço depois do '$', se não existir</div><div>$smsmensagem2 = str_replace("R$ &nbsp;", "R$ ", $smsmensagem2); // Se, depois disto, houver 2 espaços, trocar por apenas um</div><div>$smsmensagem2 = str_replace("$", "\x24", $smsmensagem2); &nbsp;// Troca o cifrão por seu código ascii (apenas um teste, ainda não testei).</div></div><div><br></div><div><span style="font-size: 12pt;">$mensagem = URLify::downcode($receivedmensagem); // Muda todos os caractéres acentuados.</span></div><div><br></div><div><br></div><div><div>class URLify&nbsp;</div><div>{</div></div><div><br></div><div><div>&nbsp; &nbsp; public static function downcode ($text, $language = "")</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; self::init ($language);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (preg_match_all (self::$regex, $text, $matches))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i = 0; $i &lt; count ($matches[0]); $i++)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $char = $matches[0][$i];</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset (self::$map[$char]))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $text = str_replace ($char, self::$map[$char], $text);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return $text;</div><div>&nbsp; &nbsp; }</div></div><div>}</div><div><br></div><div><br></div><div>A classe&nbsp;<span style="font-size: 12pt;">URLify foi encontrada em:</span><span style="font-size: 12pt;">&nbsp;</span><a href="https://github.com/jbroadway/urlify" target="_blank" style="font-size: 12pt;">https://github.com/jbroadway/urlify</a><span style="font-size: 12pt;">;</span></div><div><br></div><div>Obrigado&nbsp;</div><div><br></div><div>Sérgio<br><div><br></div></div>                                               </div></body>
</html>