Skip to content

How to know if a string was parsed as utf-8? #406

Closed
@pboettch

Description

For my schema-validator I needed to check the length of a string value. std::length() gives the character-count which is not OK if the string is utf-8.

I wrote my own-function which works for ascii and utf-8.

Could I do it differently? Should nlohmann::json somehow inform (with a method) me about the fact that a unicode-string had been parsed?

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions