From f3efdff878837a6e576a141a899b3caf484890bd Mon Sep 17 00:00:00 2001 From: Paulo Moura Date: Wed, 27 Oct 2010 17:33:48 +0100 Subject: [PATCH] Uncommented the code that generates an error when UTF-32 BOMs are detected. --- C/iopreds.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/C/iopreds.c b/C/iopreds.c index d41d56864..56ced4325 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -2802,14 +2802,13 @@ p_open (void) (needs_bom || (st->status & Seekable_Stream_f))) { if (!check_bom(sno, st)) return FALSE; - /* - if (st->encoding == ENC_ISO_UTF32_BE || - st->encoding == ENC_ISO_UTF32_LE) - { - Yap_Error(DOMAIN_ERROR_STREAM_ENCODING, ARG1, "unsupported stream encoding"); - return FALSE; - } - */ + if (st->encoding == ENC_ISO_UTF32_BE) { + Yap_Error(DOMAIN_ERROR_STREAM_ENCODING, ARG1, "UTF-32 (BE) stream encoding unsupported"); + return FALSE; + } else if (st->encoding == ENC_ISO_UTF32_LE) { + Yap_Error(DOMAIN_ERROR_STREAM_ENCODING, ARG1, "UTF-32 (LE) stream encoding unsupported"); + return FALSE; + } } st->status &= ~(Free_Stream_f); return (Yap_unify (ARG3, t));