Difference between revisions of "GetInternetTextEncoding"

From Xojo Documentation

 
Line 35: Line 35:
 
// take an encoding and query the internet name
 
// take an encoding and query the internet name
 
Var s As String = Encodings.ISOLatin4.InternetName
 
Var s As String = Encodings.ISOLatin4.InternetName
MessageDialog.Show(s) // shows ISO-8859-4
+
MessageBox(s) // shows ISO-8859-4
 
    
 
    
 
// query encoding object for this name
 
// query encoding object for this name
Line 41: Line 41:
 
    
 
    
 
// and show it:
 
// and show it:
MessageDialog.Show(e.InternetName)
+
MessageBox(e.InternetName)
 
</rbcode>
 
</rbcode>
  

Latest revision as of 22:39, 29 August 2019

Method


When decoding mail or web pages you would use this function to get the text encoding rather than GetTextEncoding. This function is the inverse of TextEncoding.InternetName. It returns the encoding associated with a standard name for that encoding as used on the Internet.

Syntax

result=GetInternetTextEncoding(InternetEncoding)

Part Type Description
result TextEncoding Text encoding of InternetEncoding.
InternetEncoding String Internet text.

Example

// take an encoding and query the internet name
Var s As String = Encodings.ISOLatin4.InternetName
MessageBox(s) // shows ISO-8859-4

// query encoding object for this name
Var e As TextEncoding = GetInternetTextEncoding(s)

// and show it:
MessageBox(e.InternetName)

See Also

GetTextEncoding, TextEncoding functions, Encodings module.