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) {
|
void Yap_DefaultStreamOps(StreamDesc *st) {
|
||||||
st->stream_wputc = put_wchar;
|
st->stream_wputc = put_wchar;
|
||||||
|
st->stream_wgetc = get_wchar;
|
||||||
if (st->status & (Promptable_Stream_f)) {
|
if (st->status & (Promptable_Stream_f)) {
|
||||||
st->stream_wgetc = get_wchar;
|
st->stream_wgetc = get_wchar;
|
||||||
Yap_ConsoleOps(st, true);
|
Yap_ConsoleOps(st, true);
|
||||||
@ -1354,6 +1355,7 @@ int PlGetc(int sno) {
|
|||||||
st->encoding = enc_id( s_encoding, st->encoding);
|
st->encoding = enc_id( s_encoding, st->encoding);
|
||||||
else
|
else
|
||||||
st->encoding = encoding;
|
st->encoding = encoding;
|
||||||
|
Yap_DefaultStreamOps( st);
|
||||||
if (script)
|
if (script)
|
||||||
open_header(sno, open_mode);
|
open_header(sno, open_mode);
|
||||||
|
|
||||||
|
@ -790,7 +790,8 @@ static bool do_set_stream(int sno,
|
|||||||
Atom atEnc = AtomOfTerm(t2);
|
Atom atEnc = AtomOfTerm(t2);
|
||||||
GLOBAL_Stream[sno].encoding =
|
GLOBAL_Stream[sno].encoding =
|
||||||
enc_id(atEnc->StrOfAE, (GLOBAL_Stream[sno].status & HAS_BOM_f ? GLOBAL_Stream[sno].encoding :ENC_OCTET ) );
|
enc_id(atEnc->StrOfAE, (GLOBAL_Stream[sno].status & HAS_BOM_f ? GLOBAL_Stream[sno].encoding :ENC_OCTET ) );
|
||||||
}
|
Yap_DefaultStreamOps( GLOBAL_Stream+sno);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SET_STREAM_EOF_ACTION: {
|
case SET_STREAM_EOF_ACTION: {
|
||||||
Term t2 = args[SET_STREAM_EOF_ACTION].tvalue;
|
Term t2 = args[SET_STREAM_EOF_ACTION].tvalue;
|
||||||
|
Reference in New Issue
Block a user