Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Convert string to UTF-8

Convert string to UTF-8

Scheduled Pinned Locked Moved C#
helpcsharpwcftoolsquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dabuskol
    wrote on last edited by
    #1

    Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:

    http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl

    MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution

    SendGSM.send_sms(utfCodes);

    Dabsukol

    L S N 3 Replies Last reply
    0
    • D dabuskol

      Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:

      http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl

      MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution

      SendGSM.send_sms(utfCodes);

      Dabsukol

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      "no SMS received" means -> the error is not always in your side. The error maybe in receiver server, probably the server cannot receive arabic font. If you send the sms, and you get no error, then you must see at SMS server. Without error text, it will be impossible to find the error.

      1 Reply Last reply
      0
      • D dabuskol

        Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:

        http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl

        MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution

        SendGSM.send_sms(utfCodes);

        Dabsukol

        S Offline
        S Offline
        sanforjackass
        wrote on last edited by
        #3

        try this: byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage);

        R 1 Reply Last reply
        0
        • S sanforjackass

          try this: byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage);

          R Offline
          R Offline
          Rajesh Anuhya
          wrote on last edited by
          #4

          byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage); byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage);

          Rajesh B --> A Poor Workman Blames His Tools <--

          1 Reply Last reply
          0
          • D dabuskol

            Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:

            http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl

            MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution

            SendGSM.send_sms(utfCodes);

            Dabsukol

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            Why don't you just pass the string to web-service rather than passing byte array?

            Best wishes, Navaneeth

            D 1 Reply Last reply
            0
            • N N a v a n e e t h

              Why don't you just pass the string to web-service rather than passing byte array?

              Best wishes, Navaneeth

              D Offline
              D Offline
              dabuskol
              wrote on last edited by
              #6

              Thanks for the information. I will check with our server log the real problem and at the same time try to see for other solutions. I will keep you posted.

              Dabsukol

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups