1) first you need to make sure you're passing everything into utf8
2) urlencode text
3) pass coding=2
4) also add charset=utf8

i.e. in the end you'll get something like this:

http://localhost:13013/cgi-bin/sendsms?username=foo&password=bar&from=testarabic&to=0123456&coding=2&charset=utf8&text=%D8%A3%D9%8E%D8%A8%D9%92%D8%AC%D9%8E%D8%AF%D9%90%D9%8A%D9%8E%D9%91%D8%A9%20%D8%B9%D9%8E%D8%B1%D9%8E%D8%A8%D9%90%D9%8A%D9%8E%D9%91%D8%A9%E2%80%8E%20%E2%80%99abjadiyyah%20%E2%80%98arabiyyah

same goes for sqlbox, but you'd need just to set variables upon insert into
send_sms table.

if you want to specify specific smsc add &smsc=smsc_id parameter to the
above

2012/6/6 Mahtab Rasheed <mahtabrasheed...@gmail.com>

>
> Dear All,
>            I can successfully send SMS in English. But I want to send it in
> URDU/Arabic .....
> I searched google and got hint from this link
> http://stackoverflow.com/questions/10194047/sending-arabic-sms-in-kannel
> here
>
> I used this code but I am unable to send sms in URDU/Arabic although my
> mobile phone supports URDU. I receive rectangles on my mobile phone
>
> THis is the code which I have used .......
>
>
> ****************************************************************************
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.InputStreamReader;
> import java.io.OutputStreamWriter;
> import java.io.UnsupportedEncodingException;
> import java.net.HttpURLConnection;
> import java.net.InetSocketAddress;
> import java.net.MalformedURLException;
> import java.net.Proxy;
> import java.net.URL;
> import java.net.URLConnection;
> import java.net.URLEncoder;
> import java.util.logging.Level;
> import java.util.logging.Logger;
> /**
>  * Main.java
>  *
>  * @author www.javadb.com
>  */
> public class Main {
>
>    /**
>     * Extends the size of an array.
>     */
>    public void sendPostRequest() {
>
>       try {
>
>
>            String numTel="03478847037";
>            String text="ماھتاب";
>
>            StringBuffer aResult= new StringBuffer();
>            StringBuffer param = new StringBuffer();
>
>
>            param.append("http://192.168.214.128:13013/cgi-bin/sendsms?";);
>
>
> param.append(URLEncoder.encode("username","UTF-8")).append("=").append(URLEncoder.encode("tester","UTF-8"));
>
>
> param.append("&").append(URLEncoder.encode("password","UTF-8")).append("=").append(URLEncoder.encode("foobar","UTF-8"));
>
>
> param.append("&").append(URLEncoder.encode("to","UTF-8")).append("=").append(URLEncoder.encode(numTel,"UTF-8"));
>
>
>
> param.append("&").append(URLEncoder.encode("coding","UTF-8")).append("=").append(URLEncoder.encode("2","UTF-8"));
>
>
> param.append("&").append(URLEncoder.encode("text","UTF-8")).append("=").append(URLEncoder.encode(text,"UTF-8"));
>
>
>           try {
>
>
>                URL url = new URL(param.toString());
>                   System.out.println("INFO : Opening connection ");
>                     System.out.println(param.toString());
>
>                   HttpURLConnection urlconnection = (HttpURLConnection)
> url.openConnection();
>                   System.out.println("INFO : Connection openned");
>                   BufferedReader input = new BufferedReader( new
> InputStreamReader(urlconnection.getInputStream()));
>                   String inputLine;
>
>           while ((inputLine = input.readLine()) != null)
>               aResult.append(inputLine);
>           //input.close();
>       }catch(Exception e){
>           e.printStackTrace();
>
>       }
>
>       System.out.println("response : "+aResult.toString());
>       System.out.println("INFO : all sent disconnect.");
>       }
>               catch (UnsupportedEncodingException ex)
>               {
>            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null,
> ex);
>        }
>    }
>    /**
>     * Starts the program
>     *
>     * @param args the command line arguments
>     */
>    public static void main(String[] args) {
>        new Main().sendPostRequest();
>    }
> }
>
> ****************************************************************************
>
>
> Please please help me ...................... We are developing a system to
> SMS to farmers as they cannot understand English but local Language (URDU)
>
>
> Regards,
>
> Mahtab Rasheed
> Pakistan
> --
> View this message in context:
> http://old.nabble.com/Send-SMS-in-URDU-Arabic-tp33968221p33968221.html
> Sent from the Kannel - User mailing list archive at Nabble.com.
>
>
>

Reply via email to