By prolog's built-in function
file::save("DataBaseDB.txt", DataBaseDB)
we could save class facts which we want to "DataBaseDB.txt".
The .txt file coded by **Unicode** by default.
So,
could we get .txt file coded by **ANSI** or else
by some configures or use some codes in Prolog itself?
If it could ,how?
Millions of thanks!
how to get .txt file coded by ANSI ,not by Unicode by default?
In me the tiger sniffs the rose.
Got a solution!
Guys,today I find a function,
file::save/3
save : (
string FileName,
factDB FactSection,
boolean IsUnicodeFile).
I used to use file::save/2 until I find file::save/3 .
So , I add an argument ,it'll be ok.
Thanks all the same.
welcome to other solutions to out txt file coded in ANSI or else!
In me the tiger sniffs the rose.
- Thomas Linder Puls
- VIP Member
- Posts: 1401
- Joined: 28 Feb 2000 0:01
The "normal" way to get control over the file format is by creating a file stream yourself and then save to that:
There are many create predicates create8 creates a file in the code page your system is set to use, i.e. one that is suitable for your Windows language.
Code: Select all
S = outputStream_file::create8("DataBaseDB.txt"),
S:save(databaseDB),
S:close()
Regards Thomas Linder Puls
PDC
PDC