tf.strings.unicode_decode
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Decodes each string in input into a sequence of Unicode code points.
tf.strings.unicode_decode(
    input, input_encoding, errors='replace', replacement_char=65533,
    replace_control_characters=False, name=None
)
result[i1...iN, j] is the Unicode codepoint for the jth character in
input[i1...iN], when decoded using input_encoding.
| Args | 
|---|
| input | An Ndimensional potentially raggedstringtensor with shape[D1...DN].Nmust be statically known. | 
| input_encoding | String name for the unicode encoding that should be used to
decode each string. | 
| errors | Specifies the response when an input string can't be converted
using the indicated encoding. One of: 
'strict': Raise an exception for any illegal substrings.'replace': Replace illegal substrings withreplacement_char.'ignore': Skip illegal substrings. | 
| replacement_char | The replacement codepoint to be used in place of invalid
substrings in inputwhenerrors='replace'; and in place of C0 control
characters ininputwhenreplace_control_characters=True. | 
| replace_control_characters | Whether to replace the C0 control characters (U+0000 - U+001F)with thereplacement_char. | 
| name | A name for the operation (optional). | 
| Returns | 
|---|
| A N+1dimensionalint32tensor with shape[D1...DN, (num_chars)].
The returned tensor is atf.Tensorifinputis a scalar, or atf.RaggedTensorotherwise. | 
Example:
>>> input = [s.encode('utf8') for s in (u'G\xf6\xf6dnight', u'\U0001f60a')]
>>> tf.strings.unicode_decode(input, 'UTF-8').tolist()
[[71, 246, 246, 100, 110, 105, 103, 104, 116], [128522]]
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2020-10-01 UTC.
  
  
  
    
      [null,null,["Last updated 2020-10-01 UTC."],[],[]]