You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "xhaktm00 (via GitHub)" <gi...@apache.org> on 2026/09/08 10:46:21 UTC

[PR] [ZEPPELIN-6699] React remote CSV export omits the UTF-8 BOM that the Angular and classic paths write [zeppelin]

xhaktm00 opened a new pull request, #5466:
URL: https://github.com/apache/zeppelin/pull/5466

   ### What is this PR for?
   The React remote builds its CSV export by hand and hands the string straight to a `Blob` with no UTF-8 BOM, so Excel reads it in the system code page and garbles non-ASCII data. The classic path prepends one through `saveAsService`, and the Angular path gets one from `XLSX.writeFile()`, so only this export was missing it. ZEPPELIN-672 added the BOM for exactly this reason.
   
   ```diff
   - const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
   + const BOM = '\uFEFF';
   + const blob = new Blob([BOM, content], { type: 'text/plain;charset=utf-8' });
   ```
   
   The xlsx branch is left alone, since that format carries its own encoding.
   
   ### What type of PR is it?
   Bug Fix
   
   ### Todos
   * [x] Prepend the BOM in the React remote CSV export
   * [x] Add a regression test asserting the saved bytes
   
   ### What is the Jira issue?
   * [ZEPPELIN-6699](https://issues.apache.org/jira/browse/ZEPPELIN-6699)
   
   ### How should this be tested?
   New spec `exportFile.spec.ts` mocks `file-saver` and inspects the bytes handed to `saveAs`, since `Blob.text()` decodes and drops a leading BOM.
   
   ```
   cd zeppelin-web-angular/projects/zeppelin-react && npm test
   ```
   
   Result: `Tests 1 failed | 67 passed (68)`. The one failure is `HTMLRenderer.spec.tsx > highlights a code block`, which fails the same way on `origin/master` without this change. Running the new spec alone passes:
   
   ```
   npx vitest run src/utils/exportFile.spec.ts   → Tests 2 passed (2)
   ```
   
   Reverting only the production change makes it fail with `expected [ 110, 97, 109 ] to deeply equal [ 239, 187, 191 ]`, so it does catch the defect.
   
   Manual: run a paragraph whose table result contains non-ASCII text, open the published paragraph with `?react=true`, and choose "Export all data as csv". The file now starts with `EF BB BF` and opens in Excel with the text intact.
   
   ### Screenshots (if appropriate)
   N/A
   
   ### Questions:
   * Does the license files need to update? No
   * Is there breaking changes for older versions? No — the BOM only makes the React export match what the other two paths already write
   * Does this needs documentation? No
   
   Note: the issue scopes this to CSV and TSV, but the React remote has no TSV path — `exportFile()` only takes `'csv' | 'xlsx'`. I'll file that parity gap as a separate issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-6699] React remote CSV export omits the UTF-8 BOM that the Angular and classic paths write [zeppelin]

Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha commented on PR #5466:
URL: https://github.com/apache/zeppelin/pull/5466#issuecomment-5617931932

   Merged into master (d276aad3).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-6699] React remote CSV export omits the UTF-8 BOM that the Angular and classic paths write [zeppelin]

Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha merged PR #5466:
URL: https://github.com/apache/zeppelin/pull/5466


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org