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 / C++ / MFC
  4. QR CODE IN ARABIC

QR CODE IN ARABIC

Scheduled Pinned Locked Moved C / C++ / MFC
8 Posts 4 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.
  • U Offline
    U Offline
    User 10510330
    wrote on last edited by
    #1

    I AM TRYING TO READ ARABIC QR CODE I HAVE GOT STRING LIKE THIS: "0E" & ChrW(2) & "!پù;ر-ً" & ChrW(5) & "üà1" & ChrW(18) & "ثV½›H$»سè" & vbBack & "“أK»V¢‎®؛" & ChrW(21) & "*" & ChrW(2) & " |" & ChrW(26) & "M§" & ChrW(18) & "uس/ءd'ق" & ChrW(15) & "•qw}َ" & ChrW(22) & "î" & ChrW(31) & "ِه" & ChrW(30) & ">›جWگ¢Kh" & vbCr IF YOU PLEASE I WANT TO CONVERT IT TO REAL STRING THANK YOU

    L D 2 Replies Last reply
    0
    • U User 10510330

      I AM TRYING TO READ ARABIC QR CODE I HAVE GOT STRING LIKE THIS: "0E" & ChrW(2) & "!پù;ر-ً" & ChrW(5) & "üà1" & ChrW(18) & "ثV½›H$»سè" & vbBack & "“أK»V¢‎®؛" & ChrW(21) & "*" & ChrW(2) & " |" & ChrW(26) & "M§" & ChrW(18) & "uس/ءd'ق" & ChrW(15) & "•qw}َ" & ChrW(22) & "î" & ChrW(31) & "ِه" & ChrW(30) & ">›جWگ¢Kh" & vbCr IF YOU PLEASE I WANT TO CONVERT IT TO REAL STRING THANK YOU

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

      That looks like Basic code, not C/C+.

      U 1 Reply Last reply
      0
      • L Lost User

        That looks like Basic code, not C/C+.

        U Offline
        U Offline
        User 10510330
        wrote on last edited by
        #3

        YES IT IS VISUAL BASIC BUT IS THERE ANY WAY TO UNDERSTAND THAT CODE

        L 1 Reply Last reply
        0
        • U User 10510330

          I AM TRYING TO READ ARABIC QR CODE I HAVE GOT STRING LIKE THIS: "0E" & ChrW(2) & "!پù;ر-ً" & ChrW(5) & "üà1" & ChrW(18) & "ثV½›H$»سè" & vbBack & "“أK»V¢‎®؛" & ChrW(21) & "*" & ChrW(2) & " |" & ChrW(26) & "M§" & ChrW(18) & "uس/ءd'ق" & ChrW(15) & "•qw}َ" & ChrW(22) & "î" & ChrW(31) & "ِه" & ChrW(30) & ">›جWگ¢Kh" & vbCr IF YOU PLEASE I WANT TO CONVERT IT TO REAL STRING THANK YOU

          D Offline
          D Offline
          Daniel Pfeffer
          wrote on last edited by
          #4

          Text in Arabic would either be written in Unicode, or using an Arabic "code page" (a throwback to the days when characters were 8 bits, and so your program had to "know" what language was encoded in codes 128..255). One way to encode Unicode in QR codes is using UTF-8. Have you tried running the raw QR data through a UTF-8 decoder? Note that if the raw QR data does not start with a BOM (Byte-order mark), you will have to try both low-endian and high-endian versions.

          Ad astra - both ways!

          U 1 Reply Last reply
          0
          • D Daniel Pfeffer

            Text in Arabic would either be written in Unicode, or using an Arabic "code page" (a throwback to the days when characters were 8 bits, and so your program had to "know" what language was encoded in codes 128..255). One way to encode Unicode in QR codes is using UTF-8. Have you tried running the raw QR data through a UTF-8 decoder? Note that if the raw QR data does not start with a BOM (Byte-order mark), you will have to try both low-endian and high-endian versions.

            Ad astra - both ways!

            U Offline
            U Offline
            User 10510330
            wrote on last edited by
            #5

            Private Sub doupdate() RichTextBox1.Text = str End Sub Private Sub SerialPort1_DataReceived(sender As Object, e As IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived Try mystring = SerialPort1.ReadLine Dim encExc As New UTF8Encoding Dim encRepl As New UTF8Encoding Dim s As String = mystring Dim index As Integer = encExc.GetByteCount(s) Dim bytes(Index + 3) As Byte encExc.GetBytes(s, 0, s.Length, bytes, 0) bytes(index) = &HFF bytes(index + 1) = &HD8 bytes(index + 2) = &HFF bytes(index + 3) = &H1 Dim enc As Encoding = encRepl str = "" Dim si As New System.Globalization.StringInfo(mystring) Dim unicodeTestArray(si.LengthInTextElements) As String For i As Integer = 0 To si.LengthInTextElements - 1 unicodeTestArray(i) = si.SubstringByTextElements(i, 1) str = str & System.Text.Encoding.UTF8.GetString(bytes) Next SerialPort1.DiscardInBuffer() Me.Invoke(New EventHandler(AddressOf doupdate)) Catch ex As Exception MsgBox("NO BARCODE") End Try End Sub BUT I GOT THE RESULT 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛

            L D 2 Replies Last reply
            0
            • U User 10510330

              Private Sub doupdate() RichTextBox1.Text = str End Sub Private Sub SerialPort1_DataReceived(sender As Object, e As IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived Try mystring = SerialPort1.ReadLine Dim encExc As New UTF8Encoding Dim encRepl As New UTF8Encoding Dim s As String = mystring Dim index As Integer = encExc.GetByteCount(s) Dim bytes(Index + 3) As Byte encExc.GetBytes(s, 0, s.Length, bytes, 0) bytes(index) = &HFF bytes(index + 1) = &HD8 bytes(index + 2) = &HFF bytes(index + 3) = &H1 Dim enc As Encoding = encRepl str = "" Dim si As New System.Globalization.StringInfo(mystring) Dim unicodeTestArray(si.LengthInTextElements) As String For i As Integer = 0 To si.LengthInTextElements - 1 unicodeTestArray(i) = si.SubstringByTextElements(i, 1) str = str & System.Text.Encoding.UTF8.GetString(bytes) Next SerialPort1.DiscardInBuffer() Me.Invoke(New EventHandler(AddressOf doupdate)) Catch ex As Exception MsgBox("NO BARCODE") End Try End Sub BUT I GOT THE RESULT 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛

              L Offline
              L Offline
              leon de boer
              wrote on last edited by
              #6

              It's Visual basic you are on a C/C++ forum it all reads like Arabic to me including the code, go to a Visual Basic forum. All I get is clearly text isn't in the right format or your code is wrong which I feel pretty confident you already worked out. So how do expect me to fix it, I can't even understand the code.

              In vino veritas

              1 Reply Last reply
              0
              • U User 10510330

                YES IT IS VISUAL BASIC BUT IS THERE ANY WAY TO UNDERSTAND THAT CODE

                L Offline
                L Offline
                leon de boer
                wrote on last edited by
                #7

                Yes read up on Visual Basic or go to a Visual Basic forum and ask.

                In vino veritas

                1 Reply Last reply
                0
                • U User 10510330

                  Private Sub doupdate() RichTextBox1.Text = str End Sub Private Sub SerialPort1_DataReceived(sender As Object, e As IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived Try mystring = SerialPort1.ReadLine Dim encExc As New UTF8Encoding Dim encRepl As New UTF8Encoding Dim s As String = mystring Dim index As Integer = encExc.GetByteCount(s) Dim bytes(Index + 3) As Byte encExc.GetBytes(s, 0, s.Length, bytes, 0) bytes(index) = &HFF bytes(index + 1) = &HD8 bytes(index + 2) = &HFF bytes(index + 3) = &H1 Dim enc As Encoding = encRepl str = "" Dim si As New System.Globalization.StringInfo(mystring) Dim unicodeTestArray(si.LengthInTextElements) As String For i As Integer = 0 To si.LengthInTextElements - 1 unicodeTestArray(i) = si.SubstringByTextElements(i, 1) str = str & System.Text.Encoding.UTF8.GetString(bytes) Next SerialPort1.DiscardInBuffer() Me.Invoke(New EventHandler(AddressOf doupdate)) Catch ex As Exception MsgBox("NO BARCODE") End Try End Sub BUT I GOT THE RESULT 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛‹’Dپآ=Ok kَ(h#¤ٌخyqْ3£ّ«X‘*£ط؛ع °r¹ة>w ��� 0D ]Gب ¾–”q›73ھـY`ْ'؛

                  D Offline
                  D Offline
                  Daniel Pfeffer
                  wrote on last edited by
                  #8

                  1. Check the encoding of your QR data. Are there extra (non-Arabic) bytes, or anything else? 2. The data that you are receiving from the serial port is 8-bit bytes. It must somehow be converted to Unicode characters, according to the encoding determined in stage (1). And lastly: 3. Move this question over to the Visual Basic forum. People there may be better able to help you with your code.

                  Ad astra - both ways!

                  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