I'm trying to read the following text snippet from a file and display it in my terminal:
Mathematics and Sciences:
∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),
ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (A ⇔ B),
2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm
However, certain characters are printed as ⍰ instead.
I'm using open() and read() to open the file by filename and read 'x' number of bytes into a character array, then I append a null terminator. I am using printf("%s", buffer) to print my character array.
My terminal displaying the output has its locale set to C.UTF-8 and the text file was saved with UTF-8 encoding on Windows 10. Do I need to account for specific character encodings when using printf()?