follow encoding directives
This commit is contained in:
parent
df7feea0aa
commit
588ef40a16
@ -190,6 +190,7 @@ static bool is_file_errors(Term t) {
|
||||
|
||||
void Yap_DefaultStreamOps(StreamDesc *st) {
|
||||
st->stream_wputc = put_wchar;
|
||||
st->stream_wgetc = get_wchar;
|
||||
if (st->status & (Promptable_Stream_f)) {
|
||||
st->stream_wgetc = get_wchar;
|
||||
Yap_ConsoleOps(st, true);
|
||||
@ -1354,6 +1355,7 @@ int PlGetc(int sno) {
|
||||
st->encoding = enc_id( s_encoding, st->encoding);
|
||||
else
|
||||
st->encoding = encoding;
|
||||
Yap_DefaultStreamOps( st);
|
||||
if (script)
|
||||
open_header(sno, open_mode);
|
||||
|
||||
|
@ -790,6 +790,7 @@ static bool do_set_stream(int sno,
|
||||
Atom atEnc = AtomOfTerm(t2);
|
||||
GLOBAL_Stream[sno].encoding =
|
||||
enc_id(atEnc->StrOfAE, (GLOBAL_Stream[sno].status & HAS_BOM_f ? GLOBAL_Stream[sno].encoding :ENC_OCTET ) );
|
||||
Yap_DefaultStreamOps( GLOBAL_Stream+sno);
|
||||
}
|
||||
break;
|
||||
case SET_STREAM_EOF_ACTION: {
|
||||
|
Reference in New Issue
Block a user