AnsweredAssumed Answered

Null characters (ASCII 0) in text fields cause WPE to truncate text

Question asked by jbarnum on Feb 4, 2014
Latest reply on May 12, 2015 by jbarnum


Null characters (ASCII 0) in text fields cause WPE to truncate text


FileMaker Server



Operating system version


Description of the issue

When a text field contains an ASCII 0 character, it truncates all text that comes after it when accessed via WPE.

Steps to reproduce the problem

Create a text field in FileMaker. Paste in a value that contains an invisible ASCII character 0, along with other text that comes after it.

Now access this field via XML Web Publishing Engine.

Expected result

I would expect that the 0 character would be either 1) preserved in the text, or 2) removed from the text, while preserving all text that comes after it.

This was the behavior in FileMaker Server 12 (it removed ASCII NULL from the XML)

If this behavior cannot be changed, then an alternate (less desirable) fix would be to allow Char(0) to return ASCII NULL instead of returning an empty string. This would at least allow us to pre-process the fields in FileMaker to strip out the bad chars. See workaround section for more details.

Actual result

The ASCII 0 is not preserved in the text, and all text that comes after it is missing from the XML.

Exact text of any error message(s) that appear


Configuration information



This is a very difficult problem to work around. I expected to be able to do Substitute( textfield; Char(0); "" ), but that doesn't work - apparently Char(0) returns an empty string instead of an ASCII NULL.

This is for MirrorSync, which needs to sync arbitrary text fields that we have no control over. In many cases, there are ASCII NULL characters embedded into text fields that have been accidentally copied and pasted years ago, and nobody knows that they exist at all, until we try to sync the text and end up truncating the result.