Skip to content

Data::Dumper feature request: Flag to use hex escapes for quoted strings instead of octal #19906

Open
@zmughal

Description

@zmughal

Module: Data::Dumper

Description

Currently the Useqq flag / qquote function of Data::Dumper only uses
\x-style hex escapes on non-ASCII codepoints and octal for others. Of note,
this means that control characters (/[\x00-\x1F]/) are represented in octal.

It might be useful to have a flag to prefer hex escapes over octal escapes for these
non-printables.

Steps to Reproduce

$ print Data::Dumper->new(["\x1f\x{FFF}"])->Useqq(1)->Terse(1)->Dump
"\37\x{fff}"

Expected behavior

$ print Data::Dumper->new(["\x1f\x{FFF}"])->Usehex(1)->Useqq(1)->Terse(1)->Dump
"\x{1f}\x{fff}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    dist-Data-Dumperissues in the dual-life blead-first Data-Dumper distribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions