The Compose key is magic

37 comments

Lobsters

🆕 blog! “A small collection of text-only websites”

A couple of years ago, I started serving my blog posts as plain text. Add .txt to the end of any URl and get a deliciously lo-fi, UTF-8, mono[chrome|space] alternative.

Here's this post in plain text - https://shkspr.mobi/blog/2025/12/a-small-collection-of-text-only-websites.txt

Obviously a webpage…

👀 Read more: https://shkspr.mobi/blog/2025/12/a-small-collection-of-text-only-websites/

#blogging #blogs #text #unicode #utf-8

Recently, we talked about #libid3tag and our intent to make a new release. So far, we have a preview of some changes that have already been made in the latest main:

- Mojibake fixes for #UTF-16 (no BOM) encoded fields.
- Some code cleanups, including warning fixes.
- Compatibility with #CMake > 4.0 (we now require CMake 3.10+)

Meanwhile, we are also working on #Doxygen documentation to better document the library too, so quite a few things are going on for libid3tag right now.

Please #Microsoft, fix the #UTF-8 drive letter bug, I'd like to have 💩:\>

REF: https://www.ryanliptak.com/blog/windows-drive-letters-are-not-limited-to-a-z/

Windows drive letters are not limited to A-Z - ryanliptak.com

If you want €:\, you can have it, sort of

Les exposants #UTF-8 ne se suivent pas, du coup on doit faire une fonction échevelée; c'est stupide, non !?

² U+00B2
³ U+00B3
¹ U+00B9
⁰ U+2070
⁴ U+2074
⁵ U+2075
⁶ U+2076
⁷ U+2077
⁸ U+2078
⁹ U+2079

```python
def to_exp(val):
if val == 1:
return chr(0x00B9)
elif val in [ 2, 3 ]:
return chr(0x00B0 + val )
else:
return chr(0x2070 + val )
return None
```

#dev

#メモ #文字コード #ANSI #JIS #Shift_JIS
#UTF-8 で書かれたテキストファイルをShift_JIS に変えたいのだけど、Notepad++でどのようにしたら良いのか分からなかった。「エンコード」の「文字セット」で「日本語 > Shift-JIS」を選ぶと日本語が文字化けしてしまう。
試しに「エンコード」の「文字セット」で「ANSI に変換」を選んだら文字化けせず、右下の文字コード表示も「ANSI」に変わった。もしかして…と検索して、今日、初めて知った。

#Windows のbatファイルをNotePad++で作成する際、最初はどうしてもデフォルトのUTF-8で保存してしまって、実行すると文字化けしてて、Shift_JIS で保存しなければいけなかったんだ…と直そうとしても方法が分からなくて、TeraPadの「文字/改行コード指定保存」を使っていたのだけど、NotePad++で「ANSI に変換」の後に保存すれば良かったのだな…と。

The best – but not good – way to limit string length | adam-p

🌘 編譯器優化何時損害效能:分支判斷勝過查找表
➤ 透過禁用編譯器自動生成的查找表,揭示分支判斷的潛在效能優勢
https://nemanjatrifunovic.substack.com/p/when-compiler-optimizations-hurt
作者在比較計算 UTF-8 字串長度不同方法時,發現使用 C++20 `<bit>` 標頭檔中的 `std::countl_one` 函式,儘管利用了硬體加速,其效能卻不如「樸實」的分支判斷法。深入分析後,發現編譯器(clang++)為優化 `switch` 語句,將其轉換為查找表,這在某些情況下反而導致效能下降。禁用查找表選項後,效能顯著提升,證明瞭分支判斷在特定場景下能帶來更好的表現,並引述了其他研究也發現類似的現象。
+ 這真是個有趣的發現!我從沒想過編譯器為了優化,反而會降低效能,尤其是在處理像 UTF-8 這種常見的字串操作時。禁用查找表的做法聽起來是個值得嘗試的技巧。
+ 文章很深入,點出了編譯器優化的盲點。雖然查找表通常能提升效能,但並非所有情況都適用。作者的實驗
#效能優化 #編譯器 #C++ #UTF-8
When Compiler Optimizations Hurt Performance

Branches can perform better than table lookups

Programming at the right level
🌗 UTF-8 歷史:Rob Pike 的親身講述
➤ 餐巾紙上的創世,一週內的實踐
https://doc.cat-v.org/bell_labs/utf-8_history
本文由 Rob Pike 講述了 UTF-8 的真實歷史,糾正了其起源和發展的常見誤解。他強調 UTF-8 並非由 IBM 設計,而是在 1992 年於一家紐澤西的餐廳餐巾紙上,由 Ken Thompson 在他眼前構思出來。兩人隨後在一週內完成了首次系統級實施,並成功將其整合到 Plan 9 作業系統中。Pike 解釋了選擇設計新編碼的原因,主要是為了克服現有 FSS/UTF 設計的不足,特別是位元流同步的關鍵能力。文章還引用了後續的郵件往來和程式碼檔案的時間戳,以佐證其敘述的準確性,並肯定了 X/Open 和 IBM 在推動 UTF-8 標準化過程中的貢獻。
+ 這纔是 UTF-8 真正誕生的故事!我一直以為是 IBM 設計的。
+ 太佩服 Ken Thompson 和 Rob Pike 的效率了,一個晚上構思
#編碼歷史 #UTF-8 #Plan 9 #Rob Pike #Ken Thompson
The history of UTF-8 as told by Rob Pike

🌗 UTF-8:一項巧妙的設計
➤ 解構 UTF-8 編碼的巧妙與相容性
https://iamvishnu.com/posts/utf8-is-brilliant-design
本文深入解析了 UTF-8 編碼的精妙之處,說明瞭它如何透過一至四位元組的可變長度機制,巧妙地表示數百萬種 Unicode 字元,同時又能與傳統的 ASCII 編碼完美相容。文章詳細闡述了其位元組結構,展示瞭如何透過首位元組的特定模式來判斷字元的長度,並結合後續的延續位元組來重建字元的碼點,進而顯示對應的字元,並透過實際的文字和表情符號檔案範例,驗證了此機制的運作。
+ 原來 UTF-8 的設計這麼有智慧!尤其對 ASCII 的相容性,真是太厲害了。
+ 這篇文章的解釋很清楚,終於搞懂了 UTF-8 的原理,特別是那個位元組模式的判斷。
#編碼 #Unicode #UTF-8 #ASCII #技術
UTF-8 is a Brilliant Design — Vishnu's Pages

Exploring the brilliant design of UTF-8 encoding system that represents millions of characters while being backward compatible with ASCII