Encoding
No edit summary
(Automatically adding template at the end of the page.)
(6 intermediate revisions by 3 users not shown)
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)
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, try to decode it with:
* Encoding.[[OCLOperators Default|Default]].GetString(bytearray)


If you have data that you think is encoded with ISO-8859-1you should try and decode it with:
===== See also =====
 
* [[OCLOperators ASCII|ASCII]]
Encoding.Default.GetString(bytearray)
* [[OCLOperators BigEndianUnicode|BigEndianUnicode]]
* [[OCLOperators Default|Default]]
* [[OCLOperators Unicode|Unicode]]
* [[OCLOperators UTF32|UTF32]]
* [[OCLOperators UTF7|UTF7]]
* [[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|2024}}

Revision as of 15:34, 10 February 2024

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 6 days ago on 06/17/2024. What links here