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

All about user-defined episode / movie / file name format expressions
Post Reply
WeBoat
Posts: 3
Joined: 14 Aug 2025, 13:23

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

Post 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
User avatar
rednoah
The Source
Posts: 24111
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows vs Macos

Post 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(' ');
})
:idea: Please read the FAQ and How to Request Help.
WeBoat
Posts: 3
Joined: 14 Aug 2025, 13:23

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

Post by WeBoat »

Excellent! I was hoping it was something like that. Much thanks!
User avatar
rednoah
The Source
Posts: 24111
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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?
:idea: Please read the FAQ and How to Request Help.
WeBoat
Posts: 3
Joined: 14 Aug 2025, 13:23

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

Post 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.
Post Reply