View Single Post
  #3 (permalink)  
Old May 9th, 2005, 04:08 PM
BrianWren BrianWren is offline
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

If UTF-8 is unicode, and you want just the bytes of the ASCII characters, you can do this (built in conversion in VBA):
Code:
    Dim bString() As Byte
    Dim strSource As String
    Dim i         As Integer

    strSource = "ABC"          ' strSource contains 65  0  66  0  67  0
    bString() = strSource      ' bString contains   65  66  67

    For i = LBound(bString) To UBound(bString)
        bString(i) = bString(i) + 1
    Next i
    strSource = bString()      ' strSource contains 66  0  67  0  68  0

    Debug.Print strSource      ' Prints "BCD"
Reply With Quote