txt: ## decode.md
  decode
  
  Combined from primary sources listed below.
  
  # [In role Blob](#___top "go to top of document")[§](#(role_Blob)_method_decode "direct link")
  
  See primary documentation
  [in context](/type/Blob#method_decode)
  for **method decode**.
  
  ```raku
  multi method decode(Blob:D: $encoding = self.encoding // "utf-8")
  ```
  
  ```raku
  multi method decode(Blob:D: $encoding, Str :$replacement!,
                      Bool:D :$strict = False)
  
  ```
  
  ```raku
  multi method decode(Blob:D: $encoding, Bool:D :$strict = False)
  ```
  
  Applies an encoding to turn the blob into a [`Str`](/type/Str); the encoding will be UTF-8 by default.
  
  ```raku
  my Blob $blob = "string".encode('utf-8');
  say $blob.decode('utf-8'); # OUTPUT: «string␤»
  ```
  
  On malformed utf-8 `.decode` will throw X::AdHoc. To handle sloppy utf-8 use [`utf8-c8`](/language/unicode#UTF8-C8).
  