title: encoding/hex: invalid byte: U+0068 'h' Golang
body: <p>I'm trying to convert a <code>string</code> into a <code>byte</code> array containing its hexadecimal values, here is the code I've written:</p>
  
  <pre><code>package main
  
  import (
       "encoding/hex"
       "fmt"
       "os"
  )
  
  func main() {
       str :="abcdefhijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789"
  
       b, err := hex.DecodeString(str)
  
       if err != nil {
               fmt.Println(err)
               os.Exit(1)
       }
  
       fmt.Printf("Decoded bytes %v \n ", b)
  }
  </code></pre>
  
  <p>Here is the link from Go PlayGround: <a href="http://play.golang.org/p/8PMEFTCYSd" rel="nofollow">http://play.golang.org/p/8PMEFTCYSd</a> </p>
  
  <p>But it's giving me the error <strong>*encoding/hex: invalid byte: U+0068 'h' Golang *</strong>. What's the problem here? I want to convert my <code>string</code> into <code>byte</code> array containing hexadecimal values of each character in the <code>string</code>. I want <code>b[n]</code> to contain hexadecimal value of <code>str[n]</code>.</p>