<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JMP 18 How to open uft-8 encoded py files? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/801712#M97748</link>
    <description>&lt;P&gt;I want to open py files with this option as well.&lt;BR /&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-25_18-25-26.png" style="width: 742px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68563iCB7BBEC0E9A4D2CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-25_18-25-26.png" alt="2024-09-25_18-25-26.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2024 10:28:00 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2024-09-25T10:28:00Z</dc:date>
    <item>
      <title>JMP 18 How to open uft-8 encoded py files?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/801701#M97747</link>
      <description>&lt;P&gt;My JMP is already set to "gb2312".&lt;BR /&gt;It can no longer choose the encoding to open this PY file the way it would open a txt file.&lt;BR /&gt;And JMP does not run this PY code correctly.&lt;BR /&gt;I don't want to set JMP to "utf-8".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-25_18-01-08.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68562i1529F977CDDE7482/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-25_18-01-08.png" alt="2024-09-25_18-01-08.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 10:11:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/801701#M97747</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-25T10:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 18 How to open uft-8 encoded py files?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/801712#M97748</link>
      <description>&lt;P&gt;I want to open py files with this option as well.&lt;BR /&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-25_18-25-26.png" style="width: 742px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68563iCB7BBEC0E9A4D2CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-25_18-25-26.png" alt="2024-09-25_18-25-26.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 10:28:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/801712#M97748</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-25T10:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 18 How to open uft-8 encoded py files?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/802131#M97814</link>
      <description>&lt;P&gt;JMP specifically initializes Python as UTF-8. &amp;nbsp;You can try the standard Python mechanism for specifying the encoding of the Python source, by a 'magic comment' in the source. &amp;nbsp;However, since JMP initializes Python only once per run of JMP I'm not sure that this technique below will work. &amp;nbsp;If it does work, it would have to be the very first script run, but even that may be too late as JMP internally runs some small Python scripts to set up the environment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See:&amp;nbsp;&lt;A href="https://peps.python.org/pep-0263/" target="_blank"&gt;https://peps.python.org/pep-0263/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Python will default to ASCII as standard encoding if no other encoding hints are given.&lt;/P&gt;
&lt;P&gt;To define a source code encoding, a magic comment must be placed into the source files either as first or second line in the file, such as:&lt;/P&gt;
&lt;DIV class="highlight-default notranslate"&gt;
&lt;DIV class="highlight"&gt;
&lt;PRE&gt;&lt;SPAN class="c1"&gt;# coding=&amp;lt;encoding name&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;or (using formats recognized by popular editors):&lt;/P&gt;
&lt;DIV class="highlight-default notranslate"&gt;
&lt;DIV class="highlight"&gt;
&lt;PRE&gt;&lt;SPAN class="ch"&gt;#!/usr/bin/python&lt;/SPAN&gt;
&lt;SPAN class="c1"&gt;# -*- coding: &amp;lt;encoding name&amp;gt; -*-&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;or:&lt;/P&gt;
&lt;DIV class="highlight-default notranslate"&gt;
&lt;DIV class="highlight"&gt;
&lt;PRE&gt;&lt;SPAN class="ch"&gt;#!/usr/bin/python&lt;/SPAN&gt;
&lt;SPAN class="c1"&gt;# vim: set fileencoding=&amp;lt;encoding name&amp;gt; :&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;More precisely, the first or second line must match the following regular expression:&lt;/P&gt;
&lt;DIV class="highlight-default notranslate"&gt;
&lt;DIV class="highlight"&gt;
&lt;PRE&gt;&lt;SPAN class="o"&gt;^&lt;/SPAN&gt;&lt;SPAN class="p"&gt;[&lt;/SPAN&gt; \&lt;SPAN class="n"&gt;t&lt;/SPAN&gt;\&lt;SPAN class="n"&gt;f&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;&lt;SPAN class="o"&gt;*&lt;/SPAN&gt;&lt;SPAN class="c1"&gt;#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;If this does not solve the issue, please contact JMP Technical Support and file a bug report. &amp;nbsp;I will ask our testing team to check out variations where JMP encoding used is not UTF-8.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 18:36:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-18-How-to-open-uft-8-encoded-py-files/m-p/802131#M97814</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-09-26T18:36:01Z</dc:date>
    </item>
  </channel>
</rss>

