[m-rev.] for review: Check for surrogates when converting list of char to string.

Mark Brown mark at mercurylang.org
Tue Oct 29 19:21:38 AEDT 2019


On Tue, Oct 29, 2019 at 12:02 PM Peter Wang <novalazy at gmail.com> wrote:

> @@ -171,10 +171,9 @@
>  :- mode to_rev_char_list(uo, in) is det.
>
>      % Convert a list of characters (code points) to a string.
> -    % Throws an exception if the list of characters contains a null
> character.
> -    %
> -    % NOTE: In the future we may also throw an exception if the list
> contains
> -    % a surrogate code point.
> +    % Throws an exception if the list contains a null character or code
> point
> +    % that cannot be encoded in a string (namely, surrogate code points
> cannot
> +    % be encoded in UTF-8 strings).
>      %
>      % The forward mode of from_char_list/2 is deprecated because the
> implied
>

It wasn't part of your change, but this should say reverse not forward.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20191029/da47c407/attachment.html>


More information about the reviews mailing list