Encoding
No edit summary
No edit summary
Line 1: Line 1:
In OCL, you can use the standard .net Encoding static class.
In OCL, you can use the standard .net Encoding static class.


You can convert both strings and byte arrays using:
Convert both strings and byte arrays using:
* GetBytes(string)
# GetBytes(string)
* GetString(bytearray)
# GetString(bytearray)
''For example:''
''For example:''
* Encoding.[[OCLOperators ASCII|ASCII]].GetString(bytearray)
* Encoding.[[OCLOperators ASCII|ASCII]].GetString(bytearray)

Revision as of 06:46, 3 August 2023

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

This page was edited 94 days ago on 06/17/2024. What links here