Loading ...
Sorry, an error occurred while loading the content.

NTP 6.12 and UTF-8

Expand Messages
  • corl_deluna
    Hi, I asked this in NoteTab-HTML, but that might have been the wrong place. Last I knew NTP didn t write UTF-8 characters. When looking to see if there was a
    Message 1 of 9 , Nov 1, 2009
    • 0 Attachment
      Hi,

      I asked this in NoteTab-HTML, but that might have been the wrong place.

      Last I knew NTP didn't write UTF-8 characters. When looking to see if there was a UTF-8 converter, I noticed the latest release of NTP said that they, "Added optional code page token support in template headers. The code page value is placed between parentheses and is preceded by the letters CP. The code page value should be one of the numeric values listed on the Microsoft Web site. This example creates a new UTF-8 document:
      = DocTemplate CP(65001)"

      Does NTP now write UTF-8 documents from a template? If so, are their bugs it's still working out? Please let me know how well you think it works.

      Thanks,
      Corl
    • Sheri
      ... Works fine, but for htm files you still need to have the proper meta tag in the document with charset=utf-8. Also in View|Options Internet tag, the HTML
      Message 2 of 9 , Nov 2, 2009
      • 0 Attachment
        --- In notetab@yahoogroups.com, "corl_deluna" <corl@...> wrote:
        >
        > Last I knew NTP didn't write UTF-8 characters. When looking to
        > see if there was a UTF-8 converter, I noticed the latest release
        > of NTP said that they, "Added optional code page token support in
        > template headers. The code page value is placed between
        > parentheses and is preceded by the letters CP. The code page
        > value should be one of the numeric values listed on the Microsoft
        > Web site. This example creates a new UTF-8 document:

        > = DocTemplate CP(65001)"
        >
        > Does NTP now write UTF-8 documents from a template? If so, are
        > their bugs it's still working out? Please let me know how well
        > you think it works.

        Works fine, but for htm files you still need to have the proper meta tag in the document with charset=utf-8.

        Also in View|Options Internet tag, the HTML Header section should have something like this:

        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="generator" content="NoteTab Pro">
        <title>*** Your Title Here ***</title>
        </head>
        <body>

        if you want to make utf-8 files using Modify|Document to HTML

        Regards,
        Sheri
      • corl_deluna
        Hi Sheri, This is so good to hear. I assumed as much regarding the meta data, and thanks for the running start. Is
        Message 3 of 9 , Nov 2, 2009
        • 0 Attachment
          Hi Sheri,

          This is so good to hear.

          I assumed as much regarding the meta data, and thanks for the running start. Is <meta name="generator" content="NoteTab Pro"> optional, or does it trigger NTP to write the utf-8 characters?

          Thanks so very much,
          Corl

          > Works fine, but for htm files you still need to have the proper meta tag in the document with charset=utf-8.
          >
          > Also in View|Options Internet tag, the HTML Header section should have something like this:
          >
          > <head>
          > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          > <meta name="generator" content="NoteTab Pro">
          > <title>*** Your Title Here ***</title>
          > </head>
          > <body>
          >
          > if you want to make utf-8 files using Modify|Document to HTML
          >
          > Regards,
          > Sheri
        • Sheri
          ... AFAIK the generator part is optional. Just what I have in mine. Regards, Sheri
          Message 4 of 9 , Nov 2, 2009
          • 0 Attachment
            --- In notetab@yahoogroups.com, "corl_deluna" <corl@...> wrote:
            >
            > I assumed as much regarding the meta data, and thanks for the
            > running start. Is <meta name="generator" content="NoteTab Pro">
            > optional, or does it trigger NTP to write the utf-8 characters?

            AFAIK the generator part is optional. Just what I have in mine.

            Regards,
            Sheri
          • ebbtidalflats
            The default generator name comes from the html.tpl template: ... ^P which is loaded by
            Message 5 of 9 , Nov 3, 2009
            • 0 Attachment
              The default "generator" name comes from the "html.tpl" template:

              ...
              <META NAME="generator" CONTENT="^$GetProgName$ ^$GetProgVersion$">^P

              which is loaded by the html.clb library, when you create an html document:

              the clip "New Web page" contains:

              ^!Open ^$GetTemplatePath$HTML.tpl


              Eaither or both are easy enough to customize (work on a copy, or lose your custom changes during the next NoteTab upgrade).


              Cheers,


              Eb


              --- In notetab@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
              >
              > --- In notetab@yahoogroups.com, "corl_deluna" <corl@> wrote:
              > >
              > > I assumed as much regarding the meta data, and thanks for the
              > > running start. Is <meta name="generator" content="NoteTab Pro">
              > > optional, or does it trigger NTP to write the utf-8 characters?
              >
              > AFAIK the generator part is optional. Just what I have in mine.
              >
              > Regards,
              > Sheri
              >
            • corl_deluna
              Hi Sheri, I upgraded to 6.12. Then created a new template with this in the head: = DocTemplate CP(65001) Document-Title.htm
              Message 6 of 9 , Nov 9, 2009
              • 0 Attachment
                Hi Sheri,

                I upgraded to 6.12. Then created a new template with this in the head:

                = DocTemplate CP(65001) "Document-Title.htm"
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
                <html lang="en">
                <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

                Is this all I need to do to start writing UTF-8 documents? Or do I need to do more?

                Thanks a bunch,
                Corl
              • Sheri
                ... I would suggest using a file name in the template that appends a number, to avoid conflicts if you want to have multiple new documents open at once. E.g.,
                Message 7 of 9 , Nov 10, 2009
                • 0 Attachment
                  corl_deluna wrote:
                  > Hi Sheri,
                  >
                  > I upgraded to 6.12. Then created a new template with this in the head:
                  >
                  > = DocTemplate CP(65001) "Document-Title.htm"
                  > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
                  > <html lang="en">
                  > <head>
                  > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                  >
                  > Is this all I need to do to start writing UTF-8 documents? Or do I need to do more?
                  >
                  > Thanks a bunch,
                  > Corl
                  >
                  >
                  >
                  I would suggest using a file name in the template that appends a number,
                  to avoid conflicts if you want to have multiple new documents open at
                  once. E.g., "document-title%0.2d.htm". Other than that, looks ok to me.
                  Any reason you can't easily test it?

                  Regards,
                  Sheri
                • corl_deluna
                  Hi Sheri, Nice touch with the %0.2d.htm. Thank you very much. Test? When I right click on the tab of the document the UTF-8 template just made, Code Page shows
                  Message 8 of 9 , Nov 10, 2009
                  • 0 Attachment
                    Hi Sheri,

                    Nice touch with the %0.2d.htm. Thank you very much.

                    Test? When I right click on the tab of the document the UTF-8 template just made, Code Page shows System Code Page (1252). Though all the browsers show the encoding as UTF-8, except Opera 10, and Safari 4 -- which didn't specify. Or do you mean something else when you say test?

                    Though when I have "charset=windows-1252" specified and no CP(65001) in the template, it also shows System Code Page (1252).

                    This is where my confusion comes from, it seems that no matter how I have NTP templates set, it looks like NTP is really writing in 1252. But the browser renders UTF-8 or 1252 based on the "charset" in the head of the doc. Is the browser rendering is all that really matters? I thought it would take more than that.

                    Thanks,
                    Corl

                    Sheri wrote:

                    > I would suggest using a file name in the template that appends a number,
                    > to avoid conflicts if you want to have multiple new documents open at
                    > once. E.g., "document-title%0.2d.htm". Other than that, looks ok to me.
                    > Any reason you can't easily test it?
                    >
                    > Regards,
                    > Sheri
                  • Sheri
                    ... NoteTab uses code pages internally, it is not a unicode editor. That is explained in the Help file. Usually it is desirable that the document is presented
                    Message 9 of 9 , Nov 10, 2009
                    • 0 Attachment
                      --- In notetab@yahoogroups.com, "corl_deluna" <corl@...> wrote:
                      >
                      > Hi Sheri,
                      >
                      > Nice touch with the %0.2d.htm. Thank you very much.
                      >
                      > Test? When I right click on the tab of the document the UTF-8
                      > template just made, Code Page shows System Code Page (1252).
                      > Though all the browsers show the encoding as UTF-8, except Opera
                      > 10, and Safari 4 -- which didn't specify. Or do you mean
                      > something else when you say test?

                      NoteTab uses code pages internally, it is not a unicode editor. That is explained in the Help file. Usually it is desirable that the document is presented using your system code page. However, you can view documents that use other code pages, and there are some sample Cyrillic and other documents that come with NoteTab you can load and examine. UTF-8 is a unicode encoding wherein ASCII characters use the same representations as ANSI code pages. They are the first 127 characters. Other characters, such as accented characters, are encoded with multiple bytes. If you want to see the accented characters, stay with the system code page (or other appropriate code page, for Cyrillic, etc.). If you want see strange looking multiple characters instead of accented letters, use raw UTF-8.

                      The point for UTF-8 html pages is that despite that NoteTab decodes them for viewing and editing, the files are created and saved using UTF-8 encoding (i.e., multiple bytes for accented characters) and they load and can be viewed properly in the browser as UTF-8/Unicode.

                      Regards,
                      Sheri
                    Your message has been successfully submitted and would be delivered to recipients shortly.