Quote Originally Posted by WWGT View Post
Okay, I did really not realize DF_FIELD_LENGTH was in bytes. So going to UTF-8 might just cut the amount of characters you can enter in your forms in half, will be interesting to see the documentation about that.
Well... the interpretation of field length is going to depend on your specific back-end and front-end.

In DataFlex windows programs the user interface will count UTF-16 code units, which in practice means that all characters from the basic multilingual plane (BMP) will be counted as 1. So only more exotic characters (like smiles) will be be counted as 2 and will cause less characters to go into a field.

In DataFlex WebApps we are in the hands of the browsers. The HTML and JavaScript standards define that the length attribute should count UCS-2/UTF-16 code units which is consistent with windows. In my testing we found that most browsers do follow that standard. Exceptions are Internet Explorer and Edge (not sure what the new chromium based Edge does) that count characters / code points.

Now the back-end (the database). Here are the differences. MS SQL counts code units, and when using NVarChar (our recommendation) it will be UTF-16 code units and thus be consistent with the front-end. MySQL always counts characters (code points) and in DB2 it is configurable and depending on the field type.