Page 1 of 1

Windows vs Macos (Syntax Error: Unexpected character: '<0x2028>')

Posted: 14 Aug 2025, 13:27
by WeBoat
I hope this is not a NOOB issue, but I did not see it.

I have been using filebot for a few years on windows and it's worked great.

I use a customer tag script of:

```

Format: Select all

{n} - {s00e00} - {t} ({vf}{' '}{ vc =~ /HEVC|265|HEVC MAIN 10/  ? ' X265' : ' h264'}{' ' + any{hdr}{'SDR'} + ' ' }

{

def best = any{audio.max{it.StreamSize.toInteger()}}{null};
def ChannelString = any{(best.'ChannelPositionsString2'.replaceAll(/Object\sBased\s\/|(\d+)?\sobjects\s\/|0.(?=\d.\d)/, '').split(' / ').collect{ it.split('/')*.toDouble().sum() }.max()).toString()}{null};

def audioCodec = (ac == 'MP3'|| ac == 'AAC'|| ac == 'EAC3') ? ac : any{best.FormatProfile ? (best.Codec+'.'+best.FormatProfile.replaceAll(/\s?\/.*/)) : null}{best.Codec}{aco}{(audio.Codec+'.'+audio.FormatProfile).join().replaceAll(/\s?\/.*/)}{ac}{'ERROR'};

allOf{audioCodec}{any{ChannelString}{channels}}.join(' ')
;
})

```
and again it's worked great.

Now I am switch over to macos. And i have copied it directly and it will not work.

The first line works great but the chunk that does the audio throws and error when I try to save the script of:

Code: Select all

Syntax Error: Unexpected character: '
'
Any ideas?

Much thanks

Re: Windows vs Macos

Posted: 14 Aug 2025, 15:58
by rednoah

Code: Select all

Syntax Error: Unexpected character: '
'
:idea: The error message indeed shows that you have inadvertently added a “
” U+2028 Line Separator Unicode Character to your format. The application / software you have used to copy to on Windows / paste from on macOS likely added invisible characters along the way (e.g. automatic formatting by your word processor / email client / etc) which mangled the format code.



:arrow: Here's your format with <0x2028> removed from the code:

Format: Select all

{n} - {s00e00} - {t} ({vf}{' '}{ vc =~ /HEVC|265|HEVC MAIN 10/  ? ' X265' : ' h264'}{' ' + any{hdr}{'SDR'} + ' ' }
{
def best = any{audio.max{it.StreamSize.toInteger()}}{null};
def ChannelString = any{(best.'ChannelPositionsString2'.replaceAll(/Object\sBased\s\/|(\d+)?\sobjects\s\/|0.(?=\d.\d)/, '').split(' / ').collect{ it.split('/')*.toDouble().sum() }.max()).toString()}{null};
def audioCodec = (ac == 'MP3'|| ac == 'AAC'|| ac == 'EAC3') ? ac : any{best.FormatProfile ? (best.Codec+'.'+best.FormatProfile.replaceAll(/\s?\/.*/)) : null}{best.Codec}{aco}{(audio.Codec+'.'+audio.FormatProfile).join().replaceAll(/\s?\/.*/)}{ac}{'ERROR'};
allOf{audioCodec}{any{ChannelString}{channels}}.join(' ');
})

Re: Windows vs Macos (Syntax Error: Unexpected character: '<0x2028>')

Posted: 15 Aug 2025, 11:53
by WeBoat
Excellent! I was hoping it was something like that. Much thanks!

Re: Windows vs Macos (Syntax Error: Unexpected character: '<0x2028>')

Posted: 15 Aug 2025, 12:09
by rednoah
WeBoat wrote: 15 Aug 2025, 11:53 I was hoping it was something like that.
So out of curiosity. How did you copy & paste your format from Windows to macOS? Which intermediate software did mangle the plain/text code? Maybe something like Google Keep or Google Docs?

Re: Windows vs Macos (Syntax Error: Unexpected character: '<0x2028>')

Posted: 15 Aug 2025, 12:11
by WeBoat
I use Jump Desktop to log remotely into the windows box. It allows simple copy paste between the machines. It did mess up the line returns, i had to put them back in. Somewhere in there is most likely where the characters got messed up.