View source code
					
 Display the source code in std/utf.d from which this page was generated on
 github.
					
				
				
 Improve this page
					
 Quickly fork, edit online, and submit a pull request for this page.
 Requires a signed-in GitHub account. This works well for small changes.
 If you'd like to make larger changes you may want to consider using
 local clone.
					
				
				
 Page wiki
					
 View or edit the community-maintained wiki page associated with this page.
					
				
			
			Function std.utf.decode
			    Decodes and returns the code point starting at str[index]indexUTFExceptionindex
    decode will only work with strings and random access ranges of code units
    with length and slicing, whereas decodeFront will work with any
    input range of code units.
Prototype
dchar decode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar, S)(
  S str,
  size_t index
)
if (!isSomeString!S && isRandomAccessRange!S && hasSlicing!S && hasLength!S && isSomeChar!(ElementType!S));
					Parameters
| Name | Description | 
|---|---|
| useReplacementDchar | if invalid UTF, return replacementDcharrather than throwing | 
| str | input string or indexable Range | 
| index | starting indexinto s[]; incremented by number of code units processed | 
Returns
decoded character
Throws
        UTFException if str[index]
Authors
Walter Bright and Jonathan M Davis