Discussions related to Visual Prolog
User avatar
drspro2
VIP Member
Posts: 97
Joined: 28 Apr 2006 12:03

read file8

Unread post by drspro2 »

dear,

I open a file marked as ANSI in notepad-plus and i read in Vip with:

inputstream_file::openFile8( dataFile52 ),

but still i do not have the special characters in the program , characters like : é

( i hope e accent displays in the forum )
User avatar
drspro2
VIP Member
Posts: 97
Joined: 28 Apr 2006 12:03

Re: read file8

Unread post by drspro2 »

in another machine it works correct
User avatar
Thomas Linder Puls
VIP Member
Posts: 1401
Joined: 28 Feb 2000 0:01

Re: read file8

Unread post by Thomas Linder Puls »

"ANSI" does not really make sense for the letter é. Because "ANSI" is not a specific character set.
People often use it for "their" 8 bit character set. I don't know it means in notepad++.

openfile8 uses threadAnsi:

Code: Select all

clauses     openFile8(Filename) :-         openFile(Filename, ansi(threadAnsi)).
You could be one of the persons that have "received" utf8 as their "threadAnsi" codepage (I have not figured out who has that and why). In any case it seems that you threadAnsi codepage is not the one used to encode the file.

My guess it that it is codepageId::codePage_windows1252, and that you will therefore receive the correct contents if you use:

Code: Select all

    ... = openFile(dataFile52, ansi(codepageId::codePage_windows1252))
Regards Thomas Linder Puls
PDC
User avatar
Thomas Linder Puls
VIP Member
Posts: 1401
Joined: 28 Feb 2000 0:01

Re: read file8

Unread post by Thomas Linder Puls »

Next version of Visual Prolog (i.e. 11) will deprecate threadAnsi and you will need to be more precise when dealing with text files.
Regards Thomas Linder Puls
PDC
User avatar
drspro2
VIP Member
Posts: 97
Joined: 28 Apr 2006 12:03

Re: read file8

Unread post by drspro2 »

thankyou for the information
Post Reply