On 29 Jan 2011, at 17:05, Pew (piffle.the.cat) wrote: > I have a problem where ord() of a character (single string index) returns the > wrong value. the character is a 'o' which is a 111 value but the ord of it > returns 121 into an integer. What am I doing wrong?
Is that Lazarus code? If so, the string will be utf-8 encoded and you cannot assume that str[i] corresponds to the i'th character of the string. Even if it's not Lazarus code, it could still be utf-8 encoded depending on what the source of the string is and/or the locale settings of the system. Jonas_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal