BIFF5 write function writes underscore for Portuguese characters #3056

Open
opened 2024-01-17 13:54:10 +00:00 by VladOff99 · 0 comments

Hi I have sheetjs installed on Node v18.14.2 using TypeScript

When I try to use write with bookType: biff5 as option paramater, it replaces some characters with underscore.

Here's the code:

const data = write(workbook, {
		bookType: 'biff5',
		type: 'array',
		codepage: 1252
	}) as Uint8Array;

Here's the output from Uint8Array converted to JSON:

[
  {
    'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '22/01/2024',
    'Data Fim Periodo de Ferias (DD/MM/AAAA)': '26/01/2024'
  },
  {
    'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '22/01/2024',
    'Data Fim Periodo de Ferias (DD/MM/AAAA)': '27/01/2024'
  },
  {
    'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023',
    'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024'
  },
  {
    'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023',
    'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024'
  },
  {
    'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023',
    'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024'
  }
]

As you can see the columns names are displayed wrong, they should be displayed like this:
'Data Início Período de Férias (DD/MM/AAAA)'
'Data Fim Periodo de Ferias (DD/MM/AAAA)'

I even tried using codepage 860 from set_cptable() that uses codepage/dist/sbcs.full and still does not work.

I could be doing something wrong or it could be a bug.

Hi I have sheetjs installed on Node v18.14.2 using TypeScript When I try to use write with bookType: biff5 as option paramater, it replaces some characters with underscore. Here's the code: ```ts const data = write(workbook, { bookType: 'biff5', type: 'array', codepage: 1252 }) as Uint8Array; ``` Here's the output from Uint8Array converted to JSON: ```JSON [ { 'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '22/01/2024', 'Data Fim Periodo de Ferias (DD/MM/AAAA)': '26/01/2024' }, { 'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '22/01/2024', 'Data Fim Periodo de Ferias (DD/MM/AAAA)': '27/01/2024' }, { 'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023', 'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024' }, { 'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023', 'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024' }, { 'Data In_cio Per_odo de F_rias (DD/MM/AAAA)': '25/11/2023', 'Data Fim Periodo de Ferias (DD/MM/AAAA)': '02/01/2024' } ] ``` As you can see the columns names are displayed wrong, they should be displayed like this: 'Data Início Período de Férias (DD/MM/AAAA)' 'Data Fim Periodo de Ferias (DD/MM/AAAA)' I even tried using codepage 860 from set_cptable() that uses codepage/dist/sbcs.full and still does not work. I could be doing something wrong or it could be a bug.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3056
No description provided.