Skip to content

Octal escape sequences can be wrong formatted in C++, Java and Python #706

@mikir

Description

@mikir

Zserio version and language
Zserio: 2.16.0
Language: C++/Java/Python

Describe the bug
Zserio has different definition of octal escape sequences in string literals compared to C++, Java or Python. Zserio definition is as follows:

  • '\0[0-3]oo` where o is octal diggit, but [0-3] is optional and the last octal diggit 'o' is optional as well.

This allows writing the following string literal in Zserio:

"This is octal \0156"

Generators do not convert such octal number which results to the same string literal which is not valid in Java, C++ and Python. This is because Java, C++ and Python do support octal escape sequences in string literal in the following format:

  • '\ooo' where o is octal diggit

How to reproduce
Please, see an example schema here.

Expected behavior
Generators should convert Zserio octal escape sequences to the correct format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingc++C++ language generatorjavaJava language generatorpythonPython language generator

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions