dlang-tour / core

D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)
Boost Software License 1.0
119 stars 48 forks source link

Fix #672 - handle invalid UTF input more gently #673

Open wilzbach opened 6 years ago

wilzbach commented 6 years ago

I'm not so sure about this. It will create a lot of overhead :/

aliak00 commented 6 years ago

Could an option be to handle it lazily? I.e. wrap in try/catch and do the decoding only if there's an exception?

Or writefln it? (since it seems like writeln deals with this?)

wilzbach commented 6 years ago

I.e. wrap in try/catch and do the decoding only if there's an exception?

Yeah that does sound like the reasonable thing to do. :+1:

wilzbach commented 6 years ago
core.exception.AssertError@source/rest/apiv1.d(255): unittest failure
----------------
??:? _d_unittestp [0xdb1f6d]

Urgh that passes on my local machine (added debug output)