Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1158 (new task)

Opened 16 years ago

Last modified 14 years ago

checking char[] for being valid utf8

Reported by: elite01 Assigned to: community
Priority: normal Milestone: 1.0
Component: Tango Version: 0.99.6 Jeff
Keywords: utf8 string triage Cc:

Description

There should be an easy way to check whether a char[] is a valid utf8 string (one that doesn't start/end in the middle or contain invalid escape sequences). The closest I found is tango.text.convert.Utf.isValid(dchar), but decoding a char[] to dchar[] may already raise an exception. Additionally, a fault tolerant utf8 decoder would be a great addition for input that should be utf8, but is actually latin1 or similar (web pages, for example). (Should I open another ticket for that?)

Change History

07/02/08 08:53:03 changed by larsivi

  • owner changed from sean to kris.
  • keywords changed from utf8 string to utf8 string triage.
  • component changed from Core Functionality to Tango.
  • milestone set to 1.0.

11/09/09 08:36:37 changed by kris

  • owner changed from kris to larsivi.

thoughts, larsivi?

11/14/09 20:13:59 changed by larsivi

  • owner changed from larsivi to kris.

I think this sounds like a valid request.

As for the fault tolerant decoder - what would it decode from? latin1? But yes, it should probably be its own ticket.

04/24/10 22:32:30 changed by kris

  • owner changed from kris to community.