Storing Unicode - for cross-platform apps in MC 2.5.
Tuviah M Snyder
diskot123 at juno.com
Sat Apr 26 16:17:34 EDT 2003
>What is a good strategy for storing text so that it will have a good
chance
>of displaying correctly on different platforms using this feature. So
far I
>can't get the same text displaying on Windows and Mac.
Store the texts in fields. MC will do the byte swap automatically when
opening the stack on other platforms. If it does not display correctly
please check that the necessary languages are installed. For instance on
Windows you need to install a japanese keyboard,and restart to get
japanese fonts.
You can also save unicode text as UTF-8, and save to a custom property
for example:
to save to a custom property:
set the myunicodetext of field 1 to unidecode(the unicodetext of fld 1,
"utf8")
to read from a custom property:
set the unicodetext of fld 1 to uniencode(the myunicodetext of field
1,"utf8")
because UTF-8 is a one byte encoding, it should work fine regardless of
platform.
>I think I should be using binary data storage (so a file or custom
property)
>and storing the unicode in a platform independent format using the
>binaryEncode function... Then decoding it to the right bight order
depending
>on the user platform. Is this right?
MC will do this automatically if the text is stored in a field, and the
field is using a unicode font.
>Not sure what byte orders are on which platforms... Help appreciated.
It can change with each processor. A way to get at this info (maybe a
byteswapped function) would be useful.
>Is there a way to test whether unicode or other text encodings are
installed
>on a particular machine?
Unicode will work on all machines. A way to get a list of what fonts are
installed on a machine for a particular language is on the to-do list.
regards,
Tuviah
More information about the metacard
mailing list