Re: How to save a file with embedded unicode maths symbols

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: How to save a file with embedded unicode maths symbols

Pieter van Oostrum-2
Angus Comber <[hidden email]> writes:

> On Monday, March 9, 2020 at 1:19:16 PM UTC, Pieter van Oostrum wrote:
>> Angus Comber <***@**.c*> writes:
>>
>> > If I go to this page: https://stackify.com/solid-design-liskov-substitution-principle/
>> >
>> > There is a definition of the principle Let Φ(x) ... and I can paste that
>> > into emacs on Windows and I see the greek symbol displayed just fine.
>> >
>> > But When I go to save the file it prompts for a coding system (1st entry
>> > in list being chinese-iso-8bit). What coding system would I choose to be
>> > able to save the symbol to disk. My operating system is 64 bit Windows
>> > 7.
>>
>> You can save in any encoding that is able to encode all the characters
>> in the file. But generally the best (most useful, universal) encoding
>> is utf-8.
>>
>> However it depends on what you want to do afterwards with the file.
>> The programs that you use to process the file must be able to
>> understand that encoding. Nowadays most software understands utf-8.
>> --
>> Pieter van Oostrum
>> www: http://pieter.
>> PGP key: [8DAE142BE17999C4]
>
> If I save as filename LSP.txt and select utf-8 it saves without
> complaining but when I open the file again I see:
>
> Let Φ(x) be a property provable about objects x of type T. Then Φ(y)
> should be true for objects y of type S where S is a subtype of T.
>
> ie the phi has transformed to Φ.
>
Did you open it in Emacs?
What you see is the utf-8 encoding of Φ interpreted on reading as latin-1 (iso-8859-1) or a similar encoding, like Windows-1252. Is your Emacs configured to prefer one of these encodings?

--
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]