Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Release v0.5.8 with inline transcript editing and CLA system
Murtaza Nasirdc81f475984a
diff --git a/.github/CLA-SETUP.md b/.github/CLA-SETUP.mdnew file mode 100644index 00000000..e008176f--- /dev/null+++ b/.github/CLA-SETUP.md@@ -0,0 +1,200 @@+# CLA Assistant Setup Instructions++This document explains how to set up automated CLA checking for Speakr.++## What We're Using++**CLA Assistant** - A free, open-source GitHub Action that automatically:+- Comments on PRs asking contributors to sign the CLA+- Tracks who has signed+- Blocks PR merging until CLA is signed+- Stores signatures in a JSON file++## Setup Steps++### 1. Create a Personal Access Token (PAT)++The CLA Assistant needs a GitHub Personal Access Token to create commits for storing signatures.++1. Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)+ - Or visit: https://github.com/settings/tokens++2. Click "Generate new token" → "Generate new token (classic)"++3. Give it a descriptive name: `Speakr CLA Assistant`++4. Set expiration: `No expiration` (or your preferred duration)++5. Select scopes:+ - ✅ `repo` (Full control of private repositories)+ - ✅ `workflow` (Update GitHub Action workflows)++6. Click "Generate token"++7. **IMPORTANT**: Copy the token immediately (you won't see it again!)++### 2. Add Token to Repository Secrets++1. Go to your repository: https://github.com/murtaza-nasir/speakr++2. Navigate to: Settings → Secrets and variables → Actions++3. Click "New repository secret"++4. Name: `PERSONAL_ACCESS_TOKEN`++5. Value: Paste the token you copied in step 1++6. Click "Add secret"++### 3. Commit the CLA Files++The files have been created locally. Commit them:++```bash+git add CLA.md CONTRIBUTING.md .github/workflows/cla.yml .github/CLA-SETUP.md+git commit -m "Add Contributor License Agreement and automated CLA checking"+git push+```++### 4. Create the Signatures Branch++The CLA Assistant will store signatures in a separate branch:++```bash+# Create and push the signatures branch+git checkout -b cla-signatures+git push -u origin cla-signatures+git checkout master # or main+```++### 5. Update README.md (Optional but Recommended)++Add a badge to show CLA status. Add this near the top of README.md:++```markdown+[](https://cla-assistant.io/murtaza-nasir/speakr)+```++Add a link in the Contributing section:++```markdown+## Contributing++We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) to learn about our CLA process and development workflow.+```++### 6. Test the Setup++1. Create a test PR from a different account or ask someone to create one++2. The CLA bot should automatically comment asking for signature++3. They sign by commenting: `I have read the CLA Document and I hereby sign the CLA`++4. The bot updates the PR with a success message++## How It Works++### For Contributors++1. They open a PR+2. Bot comments with CLA instructions+3. They read [CLA.md](../CLA.md)+4. They comment: `I have read the CLA Document and I hereby sign the CLA`+5. Bot records signature in `.github/signatures/cla.json` on `cla-signatures` branch+6. Bot marks PR as CLA-signed ✅+7. Future PRs from same user are auto-approved++### For Maintainers++- You'll see CLA status checks on PRs+- Signatures are stored in `.github/signatures/cla.json`+- You can manually check signatures anytime+- Merging is only possible after CLA is signed++## Viewing Signatures++All signatures are stored in:+```+https://github.com/murtaza-nasir/speakr/blob/cla-signatures/.github/signatures/cla.json+```++Format:+```json+{+ "signedContributors": [+ {+ "name": "username",+ "id": 12345,+ "comment_id": 67890,+ "created_at": "2025-01-18T12:34:56Z",+ "repoId": 123456789,+ "pullRequestNo": 42+ }+ ]+}+```++## Troubleshooting++### Bot Not Commenting on PRs++- Check that PERSONAL_ACCESS_TOKEN secret is set+- Verify token has correct permissions+- Check GitHub Actions are enabled for repo+- Look at Actions tab for error logs++### "Branch 'cla-signatures' not found"++```bash+git checkout -b cla-signatures+git push -u origin cla-signatures+git checkout master+```++### Need to Reset Signatures++To remove all signatures (use carefully!):+```bash+git checkout cla-signatures+rm .github/signatures/cla.json+git commit -m "Reset CLA signatures"+git push+```++### Want Someone to Re-sign++Delete their entry from `.github/signatures/cla.json` and commit:+```bash+git checkout cla-signatures+# Edit .github/signatures/cla.json to remove the user+git add .github/signatures/cla.json+git commit -m "Remove CLA signature for username"+git push+git checkout master+```++## Customization++You can customize the CLA bot messages by editing `.github/workflows/cla.yml`:++- `custom-notsigned-prcomment` - Message shown to unsigned contributors+- `custom-pr-sign-comment` - Message after signing+- `custom-allsigned-prcomment` - Message when all have signed+- `allowlist` - Users who don't need to sign (bots, etc.)++## Alternative: Lighter Weight DCO++If you want something simpler, consider using **Developer Certificate of Origin (DCO)** instead:+- Contributors add `Signed-off-by: Name <email>` to commits+- No separate signature required+- Less formal but still legally binding+- Used by Linux kernel and many projects++Let me know if you'd prefer DCO instead!++## Support++- CLA Assistant Docs: https://github.com/contributor-assistant/github-action+- Issues with setup? Open an issue in this repodiff --git a/.github/workflows/cla.yml b/.github/workflows/cla.ymlnew file mode 100644index 00000000..403ff435--- /dev/null+++ b/.github/workflows/cla.yml@@ -0,0 +1,34 @@+name: "CLA Assistant"+on:+ issue_comment:+ types: [created]+ pull_request_target:+ types: [opened, closed, synchronize]++jobs:+ CLAssistant:+ runs-on: ubuntu-latest+ steps:+ - name: "CLA Assistant"+ if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'+ uses: contributor-assistant/[email protected]+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ # The path to your CLA document+ PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}+ with:+ path-to-signatures: '.github/signatures/cla.json'+ path-to-document: 'https://github.com/murtaza-nasir/speakr/blob/master/CLA.md'+ # Branch where signatures will be stored+ branch: 'cla-signatures'+ allowlist: 'bot*,dependabot*,*[bot]'++ # Message shown to contributors+ remote-organization-name: 'murtaza-nasir'+ remote-repository-name: 'speakr'+ create-file-commit-message: 'Creating CLA signature file for storing CLA signatures'+ signed-commit-message: '$contributorName has signed the CLA in #$pullRequestNo'+ custom-notsigned-prcomment: 'Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).<br/><br/>Please review the CLA here: [CLA.md](https://github.com/murtaza-nasir/speakr/blob/master/CLA.md)<br/><br/>To sign the CLA, please comment on this PR with:<br/>`I have read the CLA Document and I hereby sign the CLA`<br/><br/>This is a one-time requirement. Once you sign, all your future contributions are covered.'+ custom-pr-sign-comment: 'The CLA has been signed successfully. Thank you for your contribution!'+ custom-allsigned-prcomment: 'All contributors have signed the CLA. ✅'+ lock-pullrequest-aftermerge: falsediff --git a/.gitignore b/.gitignoreindex 528fc74a..ac879d51 100644--- a/.gitignore+++ b/.gitignore@@ -16,6 +16,9 @@ docker-compose.ymlchanges.txt!README.md+!CLA.md+!CONTRIBUTING.md+!.github/CLA-SETUP.md!docs/**/*.mddocker-compose.dev.yml.clinerulesdiff --git a/CLA.md b/CLA.mdnew file mode 100644index 00000000..e107481c--- /dev/null+++ b/CLA.md@@ -0,0 +1,83 @@+# Speakr Contributor License Agreement++Thank you for your interest in contributing to Speakr ("We" or "Us").++This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please follow the instructions at [CONTRIBUTING.md](CONTRIBUTING.md).++This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.++## 1. Definitions++"You" means the individual who Submits a Contribution to Us.++"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright.++"Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You.++"Material" means the work of authorship which is made available by Us to third parties.++"Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."++## 2. Grant of Rights++### 2.1 Copyright License++(a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement.++(b) To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3.++### 2.2 Patent License++For patent claims including, without limitation, method, process, and apparatus claims which You own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3.++### 2.3 Outbound License++Based on the grant of rights in Sections 2.1 and 2.2, if We include Your Contribution in a Material, We may license the Contribution under any license, including copyleft, permissive, commercial, or proprietary licenses. As a condition on the exercise of this right, We agree to also license the Contribution under the terms of the license or licenses which We are using for the Material on the Submission Date.++### 2.4 Moral Rights++If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect.++### 2.5 Our Rights++You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate.++### 2.6 Reservation of Rights++Any rights not expressly licensed under this section are expressly reserved by You.++## 3. Agreement++You confirm that:++(a) You have the legal authority to enter into this Agreement.++(b) You own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2.++(c) The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement.++(d) You have followed the instructions in [CONTRIBUTING.md](CONTRIBUTING.md), if You do not own the Copyright in the entire work of authorship Submitted.++## 4. Disclaimer++EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.++## 5. Consequential Damage Waiver++TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.++## 6. Miscellaneous++6.1 This Agreement will be governed by and construed in accordance with the laws of the jurisdiction in which the copyright holder primarily resides, excluding its conflicts of law provisions.++6.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings.++6.3 If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement.++6.4 The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety.++6.5 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law.++---++**By signing this agreement, you grant the Speakr project maintainers the rights described above, which allows us to maintain dual licensing (AGPLv3 and Commercial) while ensuring your valuable contributions remain part of the project.**diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 00000000..babc44d7--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,156 @@+# Contributing to Speakr++Thank you for your interest in contributing to Speakr! We appreciate your time and effort in helping improve this project.++## Ways to Contribute++There are many ways to contribute to Speakr:++- **Report Bugs**: [Open an issue](https://github.com/murtaza-nasir/speakr/issues) describing the problem+- **Suggest Features**: [Start a discussion](https://github.com/murtaza-nasir/speakr/discussions) about your idea+- **Improve Documentation**: Help us make our docs clearer and more comprehensive+- **Translate**: Help translate Speakr into more languages+- **Sponsor**: Support the project financially to enable continued development++## Code Contributions++We welcome code contributions! However, due to the dual-licensing nature of Speakr (AGPLv3 and Commercial), we require all code contributors to sign a Contributor License Agreement (CLA).++### Why We Require a CLA++Speakr is dual-licensed under:+1. **AGPLv3** - Open source license for the community+2. **Commercial License** - For organizations that cannot comply with AGPLv3++The CLA allows us to:+- Accept your valuable contributions+- Include them in both the open source and commercial versions+- Maintain flexibility to update licenses if needed in the future+- Protect the project from legal issues++**Important**: You retain copyright ownership of your contribution. The CLA simply grants us permission to use it.++### How to Sign the CLA++When you submit your first pull request, our CLA bot will automatically comment with instructions. You'll be asked to:++1. Review the [CLA document](CLA.md)+2. Sign by commenting on the PR: `I have read the CLA Document and I hereby sign the CLA`+3. Our bot will verify and mark your signature++This is a one-time process. Once you've signed, all your future contributions to Speakr are covered.++### Contribution Process++1. **Fork** the repository+2. **Create a branch** for your feature: `git checkout -b feature/my-awesome-feature`+3. **Make your changes** following our coding standards+4. **Test your changes** thoroughly+5. **Commit** with clear, descriptive messages (see our commit policy below)+6. **Push** to your fork: `git push origin feature/my-awesome-feature`+7. **Open a Pull Request** with a clear description of your changes+8. **Sign the CLA** when prompted by the bot+9. **Respond to feedback** from maintainers++### Coding Standards++- Follow the existing code style (Python PEP 8 for backend, Vue 3 conventions for frontend)+- Write clear, descriptive commit messages (see below)+- Include comments for complex logic+- Test your changes before submitting+- Keep PRs focused on a single feature or fix++### Commit Message Guidelines++Follow the format used in the project:++```+Brief description of what was done++Optional longer explanation if needed+```++**Good examples:**+- `Add inline transcript editing in speaker identification modal`+- `Fix undefined handle_openai_api_error function call in summary error handler`+- `Optimize recording view for mobile with compact layout`++**Avoid:**+- `Fixed bug`+- `Update`+- `Changes`++### Pull Request Guidelines++- Keep PRs focused on a single feature or bug fix+- Reference related issues: `Fixes #123` or `Relates to #456`+- Provide clear description of what changed and why+- Include screenshots for UI changes+- Ensure all tests pass (if applicable)+- Be responsive to review feedback++## Development Setup++See [CLAUDE.md](CLAUDE.md) for detailed development setup instructions.++### Quick Start++```bash+# Clone your fork+git clone https://github.com/YOUR-USERNAME/speakr.git+cd speakr++# Set up development environment+docker-compose -f docker-compose.dev.yml up -d --build++# Or for local development+python -m venv venv+source venv/bin/activate # On Windows: venv\Scripts\activate+pip install -r requirements.txt+python src/app.py --debug+```++## What Happens After You Submit a PR?++1. **CLA Check**: Our bot checks if you've signed the CLA+2. **Automated Tests**: CI/CD pipeline runs (if configured)+3. **Code Review**: Maintainers review your code+4. **Feedback**: You may be asked to make changes+5. **Merge**: Once approved and CLA is signed, we merge your PR!++## Alternative Ways to Help (No CLA Required)++If you cannot or prefer not to sign a CLA, you can still help:++- **Bug Reports**: Detailed bug reports are incredibly valuable+- **Feature Requests**: Share your ideas and use cases+- **Documentation**: Typo fixes, clarifications, examples+- **Translations**: Help translate the UI+- **Community Support**: Help others in discussions and issues+- **Spread the Word**: Blog posts, social media, talks about Speakr++## Questions?++- **General Questions**: [GitHub Discussions](https://github.com/murtaza-nasir/speakr/discussions)+- **Bug Reports**: [GitHub Issues](https://github.com/murtaza-nasir/speakr/issues)+- **CLA Questions**: Open an issue tagged `cla-question`++## Code of Conduct++Be respectful, inclusive, and professional. We're all here to build something great together.++- Be kind and courteous+- Respect differing viewpoints+- Accept constructive criticism gracefully+- Focus on what's best for the community+- Show empathy towards others++Violations may result in being blocked from contributing.++## License++By contributing to Speakr, you agree that your contributions will be licensed under the project's dual-license model (AGPLv3 and Commercial), as specified in the [CLA](CLA.md).++---++**Thank you for contributing to Speakr!** 🎉diff --git a/README.md b/README.mdindex 42236c7f..5a91f1ca 100644--- a/README.md+++ b/README.md@@ -80,14 +80,17 @@ Complete documentation is available at **[murtaza-nasir.github.io/speakr](https:- [Troubleshooting](https://murtaza-nasir.github.io/speakr/troubleshooting) - Common issues and solutions- [FAQ](https://murtaza-nasir.github.io/speakr/faq) - Frequently asked questions-## Latest Release (v0.5.7)+## Latest Release (v0.5.8)### Highlights-- **GPT-5 Model Support** - Automatic detection and support for GPT-5 models with advanced parameters-- **Custom Prompt Selection** - Choose between default, tag-based, or custom prompts when reprocessing summaries-- **PWA Enhancements** - Service worker for wake lock to prevent screen sleep during recording-- **Mobile Recording** - Warning banner and documentation about keeping app visible on mobile devices-- **Navigation Warnings** - Prevent accidental data loss when leaving pages with unsaved recordings+- **Inline Transcript Editing** - Edit speaker assignments and text directly within the speaker identification modal+- **Add Speaker Functionality** - Dynamically add new speakers during transcript review+- **Enhanced Speaker Modal** - Improved UX with hover-based edit controls and real-time updates++### Previous Release (v0.5.7)+- GPT-5 Model Support with automatic detection+- Custom Prompt Selection for summary reprocessing+- PWA Enhancements and mobile recording improvements## Screenshots@@ -171,6 +174,21 @@ Speakr is in active development. Planned features include a faster way to switch## Contributing-Feedback, bug reports, and feature suggestions are highly encouraged\! Please open an issue on the GitHub repository to share your thoughts.+We welcome contributions to Speakr! There are many ways to help:++- **Bug Reports & Feature Requests**: [Open an issue](https://github.com/murtaza-nasir/speakr/issues)+- **Discussions**: [Share ideas and ask questions](https://github.com/murtaza-nasir/speakr/discussions)+- **Documentation**: Help improve our docs+- **Translations**: Contribute translations for internationalization++### Code Contributions++All code contributions require signing a [Contributor License Agreement (CLA)](CLA.md). This one-time process ensures we can maintain our dual-license model (AGPLv3 and Commercial).++**See our [Contributing Guide](CONTRIBUTING.md) for complete details on:**+- How the CLA works and why we need it+- Step-by-step contribution process+- Development setup instructions+- Coding standards and best practices-**Note on Code Contributions:** Should the project begin formally accepting external code contributions, a Contributor License Agreement (CLA) will be required.+The CLA is automatically enforced via GitHub Actions. When you submit your first PR, our bot will guide you through signing.diff --git a/VERSION b/VERSIONindex 62291ae2..1b0ae03b 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-v0.5.7+v0.5.8diff --git a/docs/index.md b/docs/index.mdindex 92be0718..64ea06ed 100644--- a/docs/index.md+++ b/docs/index.md@@ -112,12 +112,16 @@ Speakr is a powerful self-hosted transcription platform that helps you capture,## Latest Updates-!!! info "Version 0.5.7 - Latest Release"+!!! info "Version 0.5.8 - Latest Release"+ - **Inline Transcript Editing** - Edit speaker assignments and text directly in the speaker identification modal+ - **Add Speaker Functionality** - Dynamically add new speakers during transcript review+ - **Enhanced Speaker Modal** - Improved UX with hover-based edit controls and real-time updates++ Previous release (v0.5.7):+- **GPT-5 Support** - Full support for OpenAI's GPT-5 model family with automatic parameter detection- **Custom Summary Prompts on Reprocessing** - Experiment with different prompts when regenerating summaries- **PWA Enhancements** - Service worker for wake lock to prevent screen sleep on mobile- - **Mobile Recording** - Documentation and warnings about keeping app visible on mobile devices- - **Navigation Warnings** - Prevent data loss with warnings when leaving pages with unsaved workPrevious release (v0.5.6):diff --git a/test_unicode_docx.py b/test_unicode_docx.pydeleted file mode 100644index b0f47909..00000000--- a/test_unicode_docx.py+++ /dev/null@@ -1,75 +0,0 @@-#!/usr/bin/env python-"""Test script to verify Unicode support in Word documents."""--from docx import Document-from docx.shared import RGBColor, Pt-from docx.oxml.ns import qn-import sys--def test_unicode_support():- """Test creating a Word document with various Unicode characters."""- doc = Document()-- # Test data with various Unicode characters- test_strings = [- ("Chinese (Simplified)", "第二次研究 - 美食与饮品词汇学习"),- ("Chinese (Traditional)", "第二次研究 - 美食與飲品詞彙學習"),- ("Japanese", "これはテストです。日本語のテキスト。"),- ("Korean", "이것은 테스트입니다. 한국어 텍스트."),- ("Arabic", "هذا اختبار. نص عربي."),- ("Hebrew", "זה מבחן. טקסט עברי."),- ("Russian", "Это тест. Русский текст."),- ("Greek", "Αυτό είναι ένα τεστ. Ελληνικό κείμενο."),- ("Thai", "นี่คือการทดสอบ ข้อความภาษาไทย"),- ("Emoji", "Testing emojis: 😀 🎉 🚀 ❤️"),- ("Mixed", "Summary: 第二次研究 with English and 中文"),- ]-- # Add title- title_text = "Unicode Font Support Test Document"- title = doc.add_heading(title_text, 0)-- # Add test strings- for language, text in test_strings:- # Add language label- p_label = doc.add_paragraph()- run = p_label.add_run(f"{language}: ")- run.bold = True-- # Add test text- p_text = doc.add_paragraph(text)-- # Apply Unicode font support if needed- try:- text.encode('ascii')- print(f"✓ {language}: ASCII only, no special font needed")- except UnicodeEncodeError:- print(f"✓ {language}: Non-ASCII detected, applying Arial font")- for run in p_text.runs:- run.font.name = 'Arial'- r = run._element- r.rPr.rFonts.set(qn('w:eastAsia'), 'Arial')-- # Save document- output_file = "test_unicode_output.docx"- doc.save(output_file)- print(f"\nTest document saved as: {output_file}")- print("Please open this document in Microsoft Word to verify all characters display correctly.")-- return True--if __name__ == "__main__":- try:- # Check if python-docx is installed- import docx- print("python-docx is installed. Version:", docx.__version__)- except ImportError:- print("ERROR: python-docx is not installed. Please install it with: pip install python-docx")- sys.exit(1)-- print("Testing Unicode support in Word documents...\n")- if test_unicode_support():- print("\nTest completed successfully!")- print("\nNOTE: The fix implemented uses Arial font which has broad Unicode support.")- print("The solution automatically detects non-ASCII characters and applies appropriate font settings.")- print("This ensures compatibility across different languages without forcing a specific font on all users.")\ No newline at end of file