AnsweredAssumed Answered

Char() function returns incorrect results

Question asked by comment on Nov 20, 2018
Latest reply on Nov 26, 2018 by TSGal

Tested in FMPA on macOS 10.13.6.



The Char() function returns incorrect results in many cases.


For example:

Char ( 65601 )

is supposed to return the LINEAR B SYLLABLE B043 A3 character (Unicode Code point 10041). Instead, the actual character returned is "A". Yes, plain capital character "A" - the same character you would get from Char (65). Try this in Data Viewer:


Exact ( Char ( 65601 ) ; "A" )


Or this:


Exact ( Char ( 65601 ) ; Char (65) )


and you will see that both return True.


The attached file contains 82,025 decimal codes for which the Char() function returns the wrong character. Each record shows the returned character along with its decimal code (in the Char_ID field). The decimal codes were produced using AppleScript (code included in the file) and verified randomly using the UnicodeChecker application. The decimal codes do not match the original decimal numbers used by the Char() function to produce these characters. Also shown are the actual characters that were expected to be returned, and a calculation demonstrating the difference.


This is not an exhaustive list - only a collection of cases that I was able to test.