Encoding
No edit summary
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In OCL, you can use the standard .net Encoding static class:
<message>Write the content here to display this box</message>
* Encoding.ASCII.GetString(bytearray)
In OCL, you can use the standard .net [[Documentation:Encoding|Encoding]] static class.
If you have data you think is encoded with ISO-8859-1, you should try and decode it with:
* Encoding.Default.GetString(bytearray)


===== See also =====
Convert both strings and byte arrays using:
* [[OCLOperators ASCII|ASCII]]
# GetBytes(string)
* [[OCLOperators BigEndianUnicode|BigEndianUnicode]]
# GetString(bytearray)
* [[OCLOperators Default|Default]]
''For example:''
* [[OCLOperators Unicode|Unicode]]
* Encoding.[[Documentation:OCLOperators ASCII|ASCII]].GetString(bytearray)
* [[OCLOperators UTF32|UTF32]]
If you have data you think is encoded with ISO-8859-1, try to decode it with:
* [[OCLOperators UTF7|UTF7]]
* Encoding.[[Documentation:OCLOperators Default|Default]].GetString(bytearray)
* [[OCLOperators UTF8|UTF8]]
 
Microsoft documentation on the Encoding class https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding
==== See also ====
* [[Documentation:OCLOperators ASCII|ASCII]]
* [[Documentation:OCLOperators BigEndianUnicode|BigEndianUnicode]]
* [[Documentation:OCLOperators Default|Default]]
* [[Documentation:OCLOperators Unicode|Unicode]]
* [[Documentation:OCLOperators UTF32|UTF32]]
* [[Documentation:OCLOperators UTF7|UTF7]]
* [[Documentation:OCLOperators UTF8|UTF8]]
Microsoft documentation on the Encoding class can be found here: https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding
[[Category:OCL]]
[[Category:OCL]]
{{Edited|July|12|2025}}

Latest revision as of 05:07, 4 February 2025

This page was created by Hans.karlsen@mdriven.net on 2019-11-21. Last edited by Stephanie@mdriven.net on 2025-02-04.

In OCL, you can use the standard .net Encoding static class.

Convert both strings and byte arrays using:

  1. GetBytes(string)
  2. GetString(bytearray)

For example:

  • Encoding.ASCII.GetString(bytearray)

If you have data you think is encoded with ISO-8859-1, try to decode it with:

  • Encoding.Default.GetString(bytearray)

See also

Microsoft documentation on the Encoding class can be found here: https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding