Advertisement

07.16.2004 at 07:38AM PDT, ID: 21061244
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Byte Array to String in VB
Tags: string, byte, array
I read in an array of bytes off the network. I need to be able to split it into an array of strings. This works fine when using system.text.encoding.ASCII, except that some of the characters are greater then 127 (they're data bytes, not string bytes) but ASCII strips them off since it is only 7-bit. Is there an "ASCII 8-bit" enconding scheme or similiar? Thanks.
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: jasoncout
Solution Provided By: TheLearnedOne
Participating Experts: 9
Solution Grade: A
Views: 1372
Translate:
Loading Advertisement...
07.16.2004 at 09:05AM PDT, ID: 11569575

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.16.2004 at 09:08AM PDT, ID: 11569599

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.16.2004 at 09:10AM PDT, ID: 11569615

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.16.2004 at 09:58AM PDT, ID: 11570144

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.16.2004 at 10:00AM PDT, ID: 11570166

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.16.2004 at 11:19AM PDT, ID: 11570902

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.19.2004 at 11:34AM PDT, ID: 11586079

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.20.2004 at 12:45PM PDT, ID: 11596731

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.25.2004 at 03:08AM PDT, ID: 11631190

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.27.2004 at 05:39AM PDT, ID: 11645758

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
09.27.2004 at 10:15PM PDT, ID: 12166654

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.28.2004 at 12:36AM PDT, ID: 12431101

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.04.2004 at 10:10PM PST, ID: 12501652

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.11.2005 at 08:44AM PST, ID: 13518616

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.24.2005 at 12:22PM PDT, ID: 14746104

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.19.2005 at 02:07PM PDT, ID: 15119845

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.21.2005 at 06:39AM PDT, ID: 15132200

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
07.16.2004 at 09:05AM PDT, ID: 11569575

Rank: Genius

Encoding.ASCII.GetString(myByteArray)

Bob
 
07.16.2004 at 09:08AM PDT, ID: 11569599
As stated in my original question, Encoding.ASCII does not work because it is based on a 7-bit character set, and some of the characters I am reading in are 8-bit.
 
07.16.2004 at 09:10AM PDT, ID: 11569615

Rank: Genius

My bad--not paying attention.

Encoding.UTF8.GetString(myByteArray))

Bob
 
07.16.2004 at 09:58AM PDT, ID: 11570144
Are characters 0-127 the same between UTF-8 and ASCII?
 
07.16.2004 at 10:00AM PDT, ID: 11570166
If a character is greater then 127 in UTF-8, doesn't it become a two-byte character? I want 0xFF to be read in as 1 character, with a value of 255.
 
07.16.2004 at 11:19AM PDT, ID: 11570902

Rank: Genius

I love those questions that push me outside of my comfort zone.  

I tried this test:

    Dim b() As Byte = {255, 128, 234, 244}

    Dim s As String = System.Text.Encoding.Default.GetString(b)

    Debug.WriteLine(s)
    Debug.WriteLine(System.Text.Encoding.Default.GetByteCount(s))

Result:

String = ÿ€êô
Byte count = 4

Default = The system's current ANSI code page.


Bob
Accepted Solution
 
07.19.2004 at 11:34AM PDT, ID: 11586079

Rank: Genius

Did this help?

Bob
 
07.20.2004 at 12:45PM PDT, ID: 11596731
I don't know if this will do exactly what you are looking for but it works well to convert byte arrays to strings for me. :)

 Private Function ByteArrayToString(ByVal arrInput() As Byte) As String
        Dim i As Integer
        Dim sOutput As New StringBuilder(arrInput.Length)
        For i = 0 To arrInput.Length - 1
            sOutput.Append(arrInput(i).ToString("X2"))
        Next
        Return sOutput.ToString()
End Function
 
07.25.2004 at 03:08AM PDT, ID: 11631190
Bob,

Try to change the first byte in your example to zero. It won't work.

The GetString function stops on zero values.

Eyal.
 
07.27.2004 at 05:39AM PDT, ID: 11645758

Rank: Genius

Strings cannot have null characters in them in VB.NET.  You would have to keep the byte array.

Bob
 
09.27.2004 at 10:15PM PDT, ID: 12166654
Id argue that a string can have a null character in VB.NET, this seems odd however as I typically use the standard method to convert a bytearray to string. are you sure this isnt an unintended consequence of using the .Default.GetString ??

When using a line like "output = Encoding.ASCII.GetString(bytestream)" to convert bytestreams that are sent using tcp sockets, i continually have to parse the string once its converted, to cut out Chr(0)'s. Try it sometime.

Jaz
 
10.28.2004 at 12:36AM PDT, ID: 12431101
Following has worked for me well.... Old way but what can I say as I am coming from a vb6 developemnt environmnet.

for i=0 to byte_arr.length
  outStr= outStr & chr(byte_arr(i))
next

msali.
 
11.04.2004 at 10:10PM PST, ID: 12501652
seems as if i have reached between big boys regarding string to byte conversion,

well i just disturbed you to thank you that unknowingly your comments have helped me a lot and specially the comments from 'TheLearnedOne' was most helpful.

thanks to 'msali' also as he showed how to convert it char by char .

also i would like to contribute a small correction in msali's code ,coz his/her current code is giving array index out of bound exception.

actually u just have to replace the byte_arr.length with (byte_arr.length-1) since the length is mesured from index 1 and array starts at index of 0.
--------------------------------------------------
for i=0 to (byte_arr.length-1)
  outStr= outStr & chr(byte_arr(i))
next
--------------------------------------------------

regards to all of you
thanks again


 
03.11.2005 at 08:44AM PST, ID: 13518616
I had a similar problem. When extracting a BLOB type (nText field) from MSSQL 7, i realized that the data in it had been encoded with what seems to be multi-byte charset (Unicode). But the problem was that the resulting byte array was also a multi-byte charset. Trying to use the binaryWriter with an appropriate encoding type (Default for ANSI CodePage), it took each byte of the stream as a char.

Took me a day to find how to fix it, but here it is :

'Read  data chunk from the DataReader (datRead)  and put it into outByte ( array of bytes )
retVal = datRead.GetBytes(0, startIndex, outByte, 0, bufferSize)

'Reencodes my outByte byte array to bytEncodeDef treating the source (outByte) as
'Unicode (Encoding.Unicode) and the destination as ANSI default code page (Encoding.Default)
bytEncodeDef = Encoding.Convert(Encoding.Unicode, Encoding.Default, outByte)

It should be noted that this code Imports System.Text.
 
08.24.2005 at 12:22PM PDT, ID: 14746104
I wrote this program to test encodings.  Pasted below is the code for the only module in a console application.  Note that ascii certainly fails the tests.  Default and 1252 (I think the same thing) pass string to byte and vice-versa, but fail converting string to char array.  Iso-8859-1 fails the string to byte, but is interesting in that it fails the byte to string but passes the byte to string to char array test.  It also passes the string to byte to string to char array, but fails the string to char array.  I believe that part of this may be in the use of ASC vs ASCW in checking the values of the string characters.  I tested one of the failures on iso-8859-1.  The asc value of byte 128 in the converted string reads as 63 with ASC, but reads properly as 128 with ASCW.  I wrote the same tests (I think) last night in c# and iso-8859-1 passed all of them, but I have still had issues with it when reading binary data aquired from legacy VB6 and windows API systems.

I think if string to byte and byte to string work, then you shouldn't need the Char array results for passing binary data.  On the other hand, you could instead use string to char array and char array to string (A test I forgot to include) instead of string to byte and byte to string if it gives more consistent results.

Anyway, here is the module....

imports System.Text

Module Module1
   Sub Main()
            Console.WriteLine("Ascii")
            TestEncoding(Encoding.ASCII)
            Console.WriteLine("Default")
            TestEncoding(Encoding.Default)
            Console.WriteLine("1252")
            TestEncoding(1252)
            Console.WriteLine("iso-8859-1")
            TestEncoding("iso-8859-1")
            Console.WriteLine("")
            Console.WriteLine("")
            Console.WriteLine("Press enter to continue...")
            Console.ReadLine()
   End Sub
      private function TestEncoding(ByVal sName as String) as boolean
            return TestEncoding(Encoding.GetEncoding(sName))
   end function
   private function TestEncoding(ByVal iCodePage as Integer) as boolean
            return TestEncoding(Encoding.GetEncoding(iCodePage))
   end function
   private function TestEncoding(ByVal oEncoding as Encoding) as Boolean
            Dim sData as String
            dim bytData as Byte()
            Dim sMsg as string
            Dim bRet as boolean
            Dim bCheck1 as Boolean
            Dim bCheck2 as boolean
            bRet = true
            
            ReDim bytData(255)            
            Dim iCount as Integer
            for iCount = 0 to 255
                  sData += chr(iCount)
                  bytData(iCount) = CByte(iCount)
                  if bytData(iCount) <> iCount then
                        stop
                  end if
                  if Asc(sdata.Substring(iCount,1))<>iCount then
                        stop
                  end if
            next
            sMsg += "   String to byte conversion length"
            Dim bytTest as Byte() = oEncoding.GetBytes(sData)
            if bytTest.Length <> 256 then
                  sMsg = sMsg + " failed" + vbCrlf
                  bRet = false
            else
                  smsg = sMsg + " passed" + vbCrlf
            end if
            sMsg += "   Byte to string conversion length"
            dim sTest as String = oEncoding.GetString(bytData)
            if sTest.Length <> 256 then
                  sMsg = sMsg + " failed" + vbCrlf
                  bret = False
            else
                  smsg = sMsg + " passed" + vbCrlf
            end if
            bCheck1 = False
            bCheck2 = false
            for iCount = 0 to 255
                  if bCheck1 = False andalso bytTest(iCount) <> iCount then
                        sMsg += "   String to byte conversion"
                        sMsg = sMsg + " failed" + vbCrlf
                        bRet = false
                        bCheck1 = true
                        if bCheck2 then exit for
                  end if
                  if bCheck2 = False AndAlso Asc(sTest.Substring(iCount,1)) <> iCount then
                        sMsg += "   Byte to string conversion"
                        sMsg = sMsg + " failed" + vbCrlf
                        bRet = false
                        bCheck2 = true
                        if bCheck1 then exit for
                  end if
            next
            if bCheck1 = False then
                  sMsg += "   String to byte conversion passed" + vbCrlf
            end if
            if bCheck2 = False then
                  sMsg += "   Byte to string conversion passed" + vbcrlf
            end if

            Dim bytTest2 as Byte() = oEncoding.GetBytes(sTest)
            sMsg += "   Byte to string to byte conversion length"
            if bytTest2.Length <> 256 then
                  sMsg = sMsg + " failed" + vbCrlf
                  bRet = false
            else
                  smsg = sMsg + " passed" + vbCrlf
            end if
            sMsg += "   String to byte to string conversion length"
            Dim sTest2 as String = oEncoding.GetString(bytTest)
            if sTest2.Length <> 256 then
                  bRet = false
                  sMsg = sMsg + " failed" + vbCrlf
            else
                  smsg = sMsg + " passed" + vbCrlf
            end if
            bCheck1 = False
            bCheck2 = false
            for iCount = 0 to 255
                  if bCheck1 = False andalso bytTest2(iCount) <> iCount then
                        sMsg += "   Byte to string to byte conversion"
                        bRet = false
                        sMsg = sMsg + " failed" + vbCrlf
                        bCheck1 = true
                        if bCheck2 then exit for
                  end if
                  if bCheck2 = False AndAlso Asc(sTest2.Substring(iCount,1)) <> iCount then
                        sMsg += "   String to byte to string conversion"
                        bRet = false
                        sMsg = sMsg + " failed" + vbCrlf
                        bCheck2 = True
                        if bcheck1 then exit for
                  end if
            next
            if bCheck1 = False then
                  sMsg += "   Byte to string to byte conversion passed" + vbCrlf
            end if
            if bCheck2 = False then
                  sMsg += "   String to byte to string conversion passed" + vbcrlf
            end if
            sMsg += "   String to char array conversion length"
            Dim cTest as Char() = sData.ToCharArray()
            if cTest.Length <> 256 then
                  bRet = false
                  sMsg = sMsg + " failed" + vbCrlf
            else
                  sMsg += " passed" + vbCrlf
            end if
            sMsg += "   String to char array conversion"
            for iCount = 0 to 255
                  if AscW(cTest(iCount)) <> iCount then
                        bRet = false
                        sMsg = sMsg + " failed" + vbCrlf
                        exit for
                  end if
            next
            sMsg += "   Byte to String to char array conversion length"
            Dim cTest2 as Char() = sTest.ToCharArray()
            if cTest2.Length <> 256 then
                  bRet = false
                  sMsg = sMsg + " failed" + vbCrlf
            else
                  sMsg += " passed" + vbCrlf
            end if
            sMsg += "   Byte to String to char array conversion"
            for iCount = 0 to 255
                  if AscW(cTest2(iCount)) <> iCount then
                        bRet = false
                        sMsg = sMsg + " failed" + vbCrlf
                        exit for
                  end if
            next
            if iCount = 256 then sMsg += " passed" + vbCrlf

            sMsg += "   String to Byte to String to char array conversion length"
            Dim cTest3 as Char() = sTest2.ToCharArray()
            if cTest3.Length <> 256 then
                  bRet = false
                  sMsg = sMsg + " failed" + vbCrlf
            else
                  sMsg += " passed" + vbCrlf
            end if
            sMsg += "   String to Byte to String to char array conversion"
            for iCount = 0 to 255
                  if AscW(cTest2(iCount)) <> iCount then
                        bRet = false
                        sMsg = sMsg + " failed" + vbCrlf
                        Exit for
                  end if
            next
            if iCount = 256 then
                  sMsg += " passed" + vbCrlf
            end if
            
            Finished:
            
            Console.WriteLine(sMsg)
   end function
End Module
 
10.19.2005 at 02:07PM PDT, ID: 15119845
Here's what I finally came up with that worked....

Private Function ByteArrayToString(ByVal ByteArray As System.Array) As String
        'Dim s As String = System.Text.Encoding.Default.GetString(ByteArray)
        Dim strOut As String = ""
        For i As Integer = 0 To ByteArray.Length - 1
            If Not CType(ByteArray(i), Byte).ToString = 0 Then
                strOut &= System.Text.Encoding.Default.GetString(ByteArray, i, 1)
            End If
        Next
        Return strOut
    End Function
 
10.21.2005 at 06:39AM PDT, ID: 15132200
Actually, this works much more quickly....

   Private Function ByteArrayToString(ByVal ByteArray As Byte()) As String
        Return System.Text.Encoding.Unicode.GetString(ByteArray)
    End Function
 
 
20080236-EE-VQP-29