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.
* Encoding.ASCII.GetString(bytearray)
 
You can convert both strings and byte arrays using
* GetBytes(string)
* GetString(bytearray)
For example
* Encoding.[[OCLOperators ASCII|ASCII]].GetString(bytearray)
If you have data you think is encoded with ISO-8859-1, you should try and decode it with:
If you have data you think is encoded with ISO-8859-1, you should try and decode it with:
* Encoding.Default.GetString(bytearray)
* Encoding.[[OCLOperators Default|Default]].GetString(bytearray)


===== See also =====
===== See also =====

Revision as of 08:15, 3 May 2023

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

You can convert both strings and byte arrays using

  • GetBytes(string)
  • GetString(bytearray)

For example

  • Encoding.ASCII.GetString(bytearray)

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

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

This page was edited 84 days ago on 02/10/2024. What links here