The character needs to be part of the font you are using for the field in question. The default fonts of Windows do not include all the available characters. There are some Unicode fonts available that have more characters. For more info see:
On my system I have found the font "Lucida Sans Unicode" that includes the following smiley character: ☺ (U+263A; UTF-8 hex: E2 98 BA). When I try to store this then everything works fine when the Unicode field (SW* and FUL) is using this font.
When I copy the smiley from your message then I get a character with the UTF-8 hex value F0 9F 99 82. As far as I can see the font "Lucida Sans Unicode" does not include this character and will correctly cause the error 0131.
Not sure if there is a straightforward solution for this - besides the filedump/fileload workaround I have mentioned before. Sorry. Maybe I can find another workaround, but probably will take some time.
Regards,
Daniel
------------------------------
Daniel Iseli
Principal Technical Support Engineer
Uniface Services
Rocket Software, Switzerland
------------------------------
Original Message:
Sent: 09-07-2022 06:58
From: Iain Sharp
Subject: 0131 - Error on field Field one or more characters not found in character set
@Daniel Iseli
I have now come to set this up as it will require manual massage of the database entries on release.
I have redefined the field as SW*, which has changed the default script generation to nvarchar(max) in the database. So I have altered the field in the database
I am trying to insert a piece of text containing a 'smiley' (🙂), which shows on the editbox on the UI. However, it is still failing with 0131 come time to store in the database.
I have changed $SYS_CHARSET and $DEF_CHARSET to UTF-8, I have set the field syntax on the field to FUL (and MUL) and nothing appears to allow me to store this character.
Am I missing something obvious?
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
Original Message:
Sent: 03-01-2022 05:55
From: Daniel Iseli
Subject: 0131 - Error on field Field one or more characters not found in character set
How is the field in question defined? The error 0131 is usually thrown when a character is not part of the allowed character set. E.g. when the field interface is C then you can only specify the characters that are part of the system character set (e.g. Windows-1252). If you use the interface W then the complete Unicode range should be possible. But you could (e.g.) limit this with the field syntax property Characters Allowed.
Scanning for "offending" characters might be a bit more tricky. You could try to save the email text with filedump using $DEF_CHARSET and then load it again. In case there's one or more character outside the character set then these will be "translated". A comparison of the original and "translated" text should then (hopefully) give you a clue. But right now I cannot think of a generic function that you could use here.
I hope this helps.
------------------------------
Daniel Iseli
Principal Technical Support Engineer
Uniface Services
Rocket Software, Switzerland
Original Message:
Sent: 02-28-2022 09:43
From: Iain Sharp
Subject: 0131 - Error on field Field one or more characters not found in character set
I'm trying to import email text into the database, for some incoming emails I'm getting the above error on the store of the text data.
Is there any intelligent way to scan for which characters are objected to so I can then make decisions about translating/ditching them?
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------