Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some special characters not escaped properly #368

Closed
chrispolley opened this issue Nov 21, 2016 · 2 comments
Closed

Some special characters not escaped properly #368

chrispolley opened this issue Nov 21, 2016 · 2 comments
Assignees

Comments

@chrispolley
Copy link

chrispolley commented Nov 21, 2016

In liquidsoap v.1.1.1, Including an actual backslash in a liquidsoap string is difficult.

For a backslash, the simple declaration:
bs = "\\"

generates an "Unterminated String" error. The second backslash appears to be escaping the second quote, which is not what I expected.

similarly, the declaration:

lf = "\\n"

does not generate a string containing a backslash-n combination, which is needed, for instance, in constructing a multi-line system call, such as using socat to set another liquidsoap instance's interactive.string variables

The work-around I have been able to come up with is to base64-encode the desired string and assign it using the base64.decode function:

lf = base64.decode("XG4=")
bs = base64.decode("XA==")

and then including them in other strings using the #{bs} or #{lf} phrase.

@toots
Copy link
Member

toots commented Jan 8, 2017

That's a smart workaround! @dbaelde maybe be able to help on this one..

@toots toots closed this as completed in ddd3090 Mar 15, 2017
@toots
Copy link
Member

toots commented Mar 15, 2017

I closed this one by adding this:

# x = "\092";;
x : string = "\\"

Also, \n can be obtained simply as:

# x = "\n";;
x : string = "\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants