Phone value with unicode direction cause empty output in xls/xlsx file

Created on 20 July 2018, over 6 years ago
Updated 23 December 2024, 1 day ago

I have a data export views display with a mandatory telephone field. When exporting the data to xls/xlsx file, sometimes the phone number becomes empty.

I change to JSON format and found there are Unicode direction control characters \u202d, \u202c surrounding the phone number, no matter it's in plain text or telephone link format. Not sure which mobile or browser add them when filling in the field, however, the direction control is used to keep the phone showing in the right direction in Arabic locale.

Those phone number with the direction control cannot export correctly into xls file, and I'd like to discuss should the issue resolved by sanitizing it in views_data_export module or propose another formatter to the telephone field in core.

This is a sample of data from my view

{
  "RID":"1",
  "FullName":"\u97cb\u5fd7\",
  "Email":"somebody@example.com",
  "Cellphone":"\u202d0912-345-6789\u202c",
  "Attendance":"Attended"
}
🐛 Bug report
Status

Closed: works as designed

Component

Code

Created by

🇹🇼Taiwan amourow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom steven jones

    I'd humbly suggest that this is a job for a field formatter: to remove the extra characters that you don't want. If however, that it's specifically that the Excel exported that is mangling the data, then maybe comment here and move the issue over to the XLS Serialization issue queue.

Production build 0.71.5 2024