Posted by: Jeff Luther
Try this variation of your PalToAscii function:
While pString != ''
! convert pString to ANSI *before* lopping it and getting its char #
Call SalStrToMultiByte( pString, pString, ENC_ANSI )
Set sRes = sRes || ' ' || SalNumberToStrX(SalStrLop(pString),0)
You can see in the attached jpg that converting to multibyte (ansi)
first, then manipulating the value, gives you the ansi char #. I think
this is what you are looking for. Note that I just added a colANSI
column to your TW.
NOTE #2, though, the you still need to keep in mind what you are
comparing: If you retrieve a pw from the db into a string var., it will
be in unicode (because the var. is unicode). And if you compare that to
some value a user types into a login data field, that too will be
unicode. You may have to convert *both* strings to ANSI and then
compare. (Though maybe both in unicode will compare ok too.)
Your issue appears to be that you are comparing a db pw *in a unicode
var* with some other source that is already in ANSI. If that's the case,
then PalToANSI() should help.
"We're storing encrypted data (paswords, etc,...) in database table
columns." - thus, they are in ANSI, right? And when you fetch back into
your appl. and compare, aren't you comparing to a user's field input,
which is also in unicode?
The 'secret' to remember is that v5.1 is *always* going to define string
vars, fields, columns, etc. in UNICODE/double-byte format. That is now
how all the SAL and VIS string functions work now in v5.1, how any
string type objects (fields, columns) work, and so on.
Jeff @ PC Design
info. & samples: www.JeffLuther.net/unify/