savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

fatal error: 'utf-8' codec can't encode characters in position #1861

Closed Russsgithub closed 3 years ago

Russsgithub commented 3 years ago

I'm doing this

s = single("s3://S3Bucket/1630132773673_Netherlands_Törf_Bistoe_nog_in_leven_2017.mp3")
output.icecast(description="audio", icy_metadata="true", format="audio/aac", %fdkaac(channels=2, samplerate=48000, bitrate=320, afterburner=true, transmux="adts", aot="mpeg4_aac_lc", sbr_mode=false), host="ice", port=8000, password="pass",mount="test",mksafe(clock(s)))

but get this error

fatal error: 'utf-8' codec can't encode characters in position 27-28: surrogates not allowed

the offending character ö should get encoded as expected ?

locale returns

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

I have the latest git main code installed

snahor commented 3 years ago

Try setting LC_ALL.

millicent-audio-mirror commented 3 years ago

Thanks @snahor , I don't know a lot about locale , but from a little research it seems to me that LC_ALL overrides the other settings , so if LANG is set to en_GB-utf-8 and I set LC_ALL to the same it will override and I'm still in the same place I was.

Saying that I will give it a go and see.

Russsgithub commented 3 years ago

@snahor , @millicent-audio-mirror is my other account, i didn't noticed i was logged in to that account for last reply.

@toots says here https://github.com/savonet/liquidsoap/issues/697#issuecomment-458276121 that liq gets its language settings from LANG, which is set.

I have tried setting LC_ALL, but it does not effect the result.

Thanks

toots commented 3 years ago

Hi @Russsgithub ! Could you send me a copy of this file? I believe this error either comes from your system or from the camomile lib but not from us.

Russsgithub commented 3 years ago

There's a copy of the file here

https://drive.google.com/file/d/1cmfHk9ReWKauIJQwd6iy1oPCoQFdg5N-/view?usp=drivesdk

If I run the was s3 cp command that comes up in the error awscli downloads the file as expected.

toots commented 3 years ago

I have downloaded the file. I can confirm the presence of the non-ascii character ö in both the filename and metadata but it seems to be working fine here. I'd suggest that this is an issue in your local configuration. Moving this to a discussion, please advise otherwise. Hopefully you find a way to fix it on your end.