Reading Char 148 from Ascii fiile

forum.gupta.bugreport (2005-2010)
Philip Hautekiet

Reading Char 148 from Ascii fiile

Post by Philip Hautekiet » 06 Feb 2008, 12:22

 Posted by:  Philip Hautekiet 

We have our own encription routine to store paswords in an ascii file.

We noticed char(148) is read as char(8221) by CTD51.

Does anyone know the solution for this one.

Thanks in advance.

Attachment: ReadChar148.apt
Attachment: pw.txt

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2167
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Reading Char 148 from Ascii fiile

Post by Jeff Luther » 06 Feb 2008, 18:24

 Posted by:  Jeff Luther 

Not sure how you wrote pw.txt, but the problem is shown in the jpg. You
have *every byte* as 94 (that's hex for 148).

Since the first 2 bytes of the file are not the BOM "FF FE" TD is
reading it in as an ANSI file. Same with Notepad. (You can see what
Notepad thinks that file format is: Read it in, then Save As... and note
the "Save as Type" it select. On my U.S. PC it shows "Text Document".)

I have corrected your PW.txt file to show what the format for char 148
(hex 94) is supposed to look like in the file that is in unicode format,
at least on my PC. char 148 doesn't show up on the field for me; likely
I don't have the correct font. But your apt now correctly lops the first
char out as 148.

Anyway, I'll enclose a zip of the correct txt and and sample APT. I
would recommend you read up on ansi vs. unicode and get yourself a hex
editor utility like HexEdit: www.hexedit.com
It is a good way to diagnose a problem. You thought there was a bug in
TD; it was your text file (and assumptions) that were the issue.

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/unify/

Attachment: pw_dump.jpg
Attachment: pw_corrected.jpg
Attachment: Read148_corrected.zip

Return to “gupta.bugreport”

Who is online

Users browsing this forum: [Ccbot] and 0 guests