[quote=429687:@Brian O’Brien]Yes they compare fine… but i though it wasn’t a sure thing.
I am learning that some encodings are partially compatible with each other.
Anything 7 bit in ascii will compare with UTF8 but not above 128.
I’m still trying to figure out if there is a way to promote all strings to UTF-16 or ISO Latin and then compare in that encoding…[/quote]
Well that may be a solution, tue best will be to make sure the encodings you receive and declare are all UTF-8 then you simply dont have these issues.
ConvertEncoding is what we use for ASCII encoded strings to UTF-8 so the dictionary keys are all equal encoding. As we sometimes had inconsistencies with keys not being equal.
There is a method on this forum somehwere that converts a string encoding to UTF-8 the easy way.
[quote=429687:@Brian O’Brien]Yes they compare fine… but i though it wasn’t a sure thing.
I am learning that some encodings are partially compatible with each other.
Anything 7 bit in ascii will compare with UTF8 but not above 128.
[/quote]
right because in ASCII there ISNT anything above 127
its only defined for 0 - 127 and anything else is NOT ascii
Convert to something that can represent everything (like UTF=8)
do NOT change case but DO normalize the strings (you’ll need declares or plugins here)
then see if they are =
if so then see if strcmp with binary returns a value of 0 meaning they are also the same bytes) if not then they are different cases (since Xojo’s comparison ignores case to say =)