title: Decoding base64 content from Github API
body: <p>Hi I'm currently trying to decode the base64 returned from the Github API <code>/:username/:repo/contents/:filepath</code> </p>
  
  <p>which returns a json object</p>
  
  <blockquote>
    <p><code>{
     "type": "file",
     "encoding": "base64",
     "size": 5362,
     "name": "README.md",
     "path": "README.md",
     "content": "encoded content ...",
     "sha": "3d21ec53a331a6f037a91c368710b99387d012c1",
     "url": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md",
     "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6&gt;f037a91c368710b99387d012c1",
     "html_url": &gt;"https://github.com/octokit/octokit.rb/blob/master/README.md",
     "download_url": &gt;"https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md",
     "_links": {
       "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1",
       "self": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md",
        "html": "https://github.com/octokit/octokit.rb/blob/master/README.md"
      }
    </code>}</p>
  </blockquote>
  
  <p>The content is encoded as base64, but when I try to decode it - it gives me random characters</p>
  
  <p><code>from googleapiclient import discovery
  from goйɽ́Ё!ɽ)ɽwWF&amp;6ƖVB6W'f6U66VB'B6W'f6T66[ܙY[X[[\ܝX]QgTS_DISCOVERY_URL='https://sheets.googleapis.c͍ٕɕٕͥМ)M.....</code></p>
  
  <p>here is my code:</p>
  
  <blockquote>
  <pre><code>   try:
         result = urlfetch.fetch(url, headers={"accept": &gt;"application/vnd.github.v3+json"})
         if result.status_code == 200:
             decoded_content = base64.b64decode(result.content)
             print(decoded_content)
          else:
                     self.response.status_code = result.status_code
  </code></pre>
  </blockquote>