Dif between FolderItem.PathTypeNative AND FolderItem.PathModes.Native

What is the difference between FolderItem.PathTypeNative AND FolderItem.PathModes.Native or maybe it is GetFolderItem?
I converted lines of code to the new version of folderitem, and specifically Native Path and GetFolderItem.
I am now getting a nilobjectexception after conversion on a Mac.
High Sierra, 2019 v3.1

The file is a straight text file, and any folderitem with a complete path is stored with EncodeBase64 and decoded with DecodeBase64.
The two lines I use are

Old and works

ts = DecodeBase64(pArrayFile(rowcnt), Encdng) pf = GetFolderItem(ts, FolderItem.PathTypeNative)

New and nilobjectexception

ts = DecodeBase64(pArrayFile(rowcnt), Encdng) pf = New FolderItem(ts, FolderItem.PathModes.Native)

The line of encoded text

I’m assuming the the encoding is the same as when it was encoded to hex ?
have you checked that you get the decoded string exactly as it was originally encoded ?

everything I know says you should be getting the correct folder item for those two calls

That’s why I posted in General. Its shouldn’t be happening.
The only thing I haven’t checked is encoding.
I always save everything as UTF8, so I think encoding is good.

How can I check it for text?
Is there an easy text comparer for Mac?

It might just be I have to reboot my computer

where does Encdng come from ?
if that is set the same when you decode as when you encoded then you should be getting back a correct file path
but I have no way to verify or check this with only 2 lines of code posted

That is set only in App.Open. I haven’t figured out encoding, so it’s just a place holder.

Encdng = Encodings.UTF8

I’ll play with stuff including rebooting the laptop.
I had another variable show up very strangely.

You were right to suspect encoding.

The difference between MidB and MiddleBytes is MidB starts at 1 and MiddleBytes starts at 0
Remove the +1 and that part works.

aFile = DefineEncoding(AFile.MiddleBytes(bomLength+1), Encdng)

Sigh. Not so easy to update

ah sure you get an off by 1 issue
you basically have to revist EVERY line of code that gets “updated” to API 2 because of this since some will change & some wont

No
And you really cant use search & replace for it either
It will be manual and tedious
This was all mentioned previously :frowning:

[quote=485225:@Arthur Gabhart]Sigh. Not so easy to update
[/quote]
Of all my API 2.0 conversions, the worst to fix have been Mid() and InStr().