Skip to content

DEL character is printed directly in string literals #8079

@jurajsic

Description

@jurajsic

The non-printable delete control character (Unicode code point U+007F or 127 in decimal) is printed directly to output in string literals instead of producing `"\u{7f}".

For example:

(declare-const x String)
(assert (= x "\u{7e}\u{7f}\u{80}"))
(check-sat)
(get-model)

produces the model

(
  (define-fun x () String
    "~�\u{80}")
)

I think the problem is in the following line

if (ch < 32 || ch >= 128 || ('\\' == ch && i + 1 < m_buffer.size() && 'u' == m_buffer[i+1])) {

The test should be ch < 32 || ch >= 127 || ...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions