Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File encoding and code page recognition
#6
The fastest is pure C# with the new program.
This code with the C# Detect function is fast too.
The slowest would be the Detect function converted to QM.

To measure code speed, use PerfX functions.
Example 1:
Macro Macro3210
Code:
Copy      Help
PerfFirst
0.01; ;;code example 1
PerfNext
0.02; ;;code example 2
PerfNext
PerfOut
Example2:
Macro Macro3198
Code:
Copy      Help
PerfFirst
rep 3
,int codePage = CsFunc("" path)
,PerfNext
PerfOut
out codePage

To make this code faster when calling the C# function many times, replace the CsFunc line with:
Code:
Copy      Help
CsScript c.AddCode("") ;;once
int codePage = c.Call("DetectCP" path) ;;for each file


Messages In This Thread
RE: File encoding and code page recognition - by Gintaras - 07-22-2022, 04:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)