[PR #186] [MERGED] feat: guess plain text encoding then set content-type charset #508

Closed
opened 2026-04-08 16:53:13 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigoden/dufs/pull/186
Author: @sigoden
Created: 2/27/2023
Status: Merged
Merged: 3/1/2023
Merged by: @sigoden

Base: mainHead: feat-guess-encoding


📝 Commits (1)

  • 331c7c0 feat: guess plain text encoding then set content-type charset

📊 Changes

5 files changed (+111 additions, -18 deletions)

View changed files

📝 Cargo.lock (+12 -0)
📝 Cargo.toml (+1 -0)
📝 src/server.rs (+35 -8)
📝 tests/fixtures.rs (+25 -8)
📝 tests/http.rs (+38 -2)

📄 Description

Both issue #185 and issue #105 are related to encoding.

Although it is not 100% accurate to know the encoding of a text file.
A guess encoding is correct most of the timeis. It's better than just displaying garbled characters.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/186 **Author:** [@sigoden](https://github.com/sigoden) **Created:** 2/27/2023 **Status:** ✅ Merged **Merged:** 3/1/2023 **Merged by:** [@sigoden](https://github.com/sigoden) **Base:** `main` ← **Head:** `feat-guess-encoding` --- ### 📝 Commits (1) - [`331c7c0`](https://github.com/sigoden/dufs/commit/331c7c0e9ea10b3d6fb8ce3cebefa31482ef4a9a) feat: guess plain text encoding then set content-type charset ### 📊 Changes **5 files changed** (+111 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+12 -0) 📝 `Cargo.toml` (+1 -0) 📝 `src/server.rs` (+35 -8) 📝 `tests/fixtures.rs` (+25 -8) 📝 `tests/http.rs` (+38 -2) </details> ### 📄 Description Both issue #185 and issue #105 are related to encoding. Although it is not 100% accurate to know the encoding of a text file. A guess encoding is correct most of the timeis. It's better than just displaying garbled characters. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-04-08 16:53:13 +03:00
zhus closed this issue 2026-04-08 16:53:13 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#508