Community
    • Login

    Mac encoding

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    14 Posts 10 Posters 17.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Claudia FrankC
      Claudia Frank @guy038
      last edited by

      Hello guy038,

      this file isn’t supposed to be used directly. It’s part of the codecs module which uses it internally
      when you specify its codec. E.g.

      import codecs
      
      with codecs.open(r'd:\macroman.txt', 'r', encoding='macroman') as fin:
          file_content = fin.read()
      
      with codecs.open(r'd:\macroman_utf8.txt', 'w', encoding='utf-8') as fout:
          fout.write(file_content)
      

      First with block opens a file which is assumed to be macroman encoded, reads it, saves it in variable file_content and
      closes file automatically.

      Next with block writes the file with utf-8 encoding and, again, closes automatically.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • Valerio JV
        Valerio J
        last edited by

        Thank you very much, guy038.
        I’m sure that’d do the trick. I’m just surprised we don’t have an option for Mac Roman right in the menu. Do you think there’s a reason for that? It’s just another encoding method, right? Is it fundamentally different from any of the iso-8859-x?

        1 Reply Last reply Reply Quote 0
        • guy038G
          guy038
          last edited by guy038

          Hi, Valerio,

          Do you think there’s a reason for that?

          May be, it’s just because Notepad++ is rather “Windows oriented” !

          Is it fundamentally different from any of the iso-8859-x?

          Not at all. It’s just an other encoding, as all the others !


          You may, also, ask for adding the MAC Roman encoding, in N++, at the address, below :

          https://github.com/notepad-plus-plus/notepad-plus-plus/pulls

          However, as you can see, you have to be ( very ) patient :-(( There are plenty of requests, in that place !!

          Cheers,

          guy038

          1 Reply Last reply Reply Quote 0
          • Ali AbdelzaherA
            Ali Abdelzaher
            last edited by

            Thanks for sharing such amazing info
            مجلة رقيقة

            1 Reply Last reply Reply Quote 0
            • Hamza HamzaH
              Hamza Hamza
              last edited by

              Thanks for sharing
              فوائد الليمون

              1 Reply Last reply Reply Quote 0
              • chcgC
                chcg
                last edited by

                At least there is an codepage on windows Code Page 10000 Macintosh Roman:
                https://msdn.microsoft.com/en-us/library/cc195076.aspx
                so adding support should be not to complicated.

                1 Reply Last reply Reply Quote 0
                • Ryan WebberR
                  Ryan Webber
                  last edited by

                  I’m trying to find a way to convert to macRoman. (needed for embedding subtitles into quicktime videos)
                  I am trying to use the python scripting option.
                  using:

                  import codecs
                  with codecs.open(r’d:\utf8.txt’, ‘r’, encoding=‘utf-8’) as fin:
                  file_content = fin.read()
                  with codecs.open(r’d:\macroman.txt’, ‘w’, encoding=‘macroman’) as fout:
                  fout.write(file_content)

                  I end up with macroman.txt encoded as ANSI, and empty.

                  Any help here would be much appreciated.

                  Claudia FrankC 1 Reply Last reply Reply Quote 0
                  • Claudia FrankC
                    Claudia Frank @Ryan Webber
                    last edited by

                    @Ryan-Webber

                    what about printing file_content to the python script console using

                    console.write(file_content)

                    Cheers
                    Claudia

                    1 Reply Last reply Reply Quote 0
                    • Aziz AbdelA
                      Aziz Abdel
                      last edited by

                      Thanks for sharing such amazing info
                      sihtk.com
                      كل ما يهمك سيدتي

                      1 Reply Last reply Reply Quote 0
                      • J. JonesJ
                        J. Jones
                        last edited by

                        I did find an Encoding option for it, but it’s buried where you wouldn’t expect!

                        Encoding > Character Sets > Cyrillic > Macintosh

                        Presto, all the Õ symbols become ’ symbols the way they were typed on the Mac!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors