<?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: Write the Degree Symbol(UTF-8) to file in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311194#M157332</link>
    <description>&lt;P&gt;Your test result doesn't match the program you show. When I compile and run the program, I get the proper "fourth" character.&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;character(3), parameter :: utf_fourth = char( int( Z'E2' )) // char(int( Z'81' )) // char(int( Z'B4' )) ! fourth power
character(3), parameter :: utf_lessequal = char(int(Z'E2')) // char(int(Z'89')) // char(int(Z'A4')) ! Less than or equal
character(3), parameter :: utf_greaterequal = char(int(Z'E2')) // char(int(Z'89')) // char(int(Z'A5')) ! Greaterthan or equal
open (unit=1,file='E:\new2.txt', form='formatted', status='unknown')

write (1,'(A,A)') "Fourth: ", utf_fourth 
write (1,'(A,A)') "Less or equal: ", utf_lessequal
write (1,'(A,A)') "Greater or equal: ", utf_greaterequal

close (1)

end&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-08-31 143543.png" style="width: 192px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19107iB66CF3589787EAD5/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screenshot 2021-08-31 143543.png" alt="Screenshot 2021-08-31 143543.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Aug 2021 18:37:04 GMT</pubDate>
    <dc:creator>Steve_Lionel</dc:creator>
    <dc:date>2021-08-31T18:37:04Z</dc:date>
    <item>
      <title>Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309057#M157241</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Currently we can do this: open a text file and write degree symbol(°F) in FORTRAN, then read this file in C++ with ANSI mode.&lt;/P&gt;
&lt;P&gt;But now if we read the same file in C++ with UTF-8 mode, we have trouble with degree symbol. Please refer to the attached screenshots.&lt;/P&gt;
&lt;P&gt;We tried to add "encoding = 'UTF-8'" option when we open the file before writing the degree symbol in FOTRAN, it doesn't help.&lt;/P&gt;
&lt;P&gt;So we have 2 questions:&lt;/P&gt;
&lt;P&gt;1. Does Intel FORTRAN support encoding UTF-8 for text file, exp. for special characters -- degree symbol, square, cube etc.?&lt;/P&gt;
&lt;P&gt;2. If yes, how should we write the degree symbol to text file in FORTRAN to let FORTRAN compiler knows this is UTF-8 mode, not ANSI mode?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 17:20:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309057#M157241</guid>
      <dc:creator>Jing1</dc:creator>
      <dc:date>2021-08-23T17:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309064#M157242</link>
      <description>&lt;P&gt;Intel Fortran does not currently support UTF-8 in files. But if you can figure out the UTF-8 encoding, you can write it as a series of bytes. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;open (unit=1,file='E:\new 2.txt', form='unformatted',access='stream',status='new')
write (1) '37',int(Z'B0C2',2)
close (1)
end&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-08-23 140040.png" style="width: 121px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/18950iB18DBCB7466B38EC/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screenshot 2021-08-23 140040.png" alt="Screenshot 2021-08-23 140040.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 18:02:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309064#M157242</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-08-23T18:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309070#M157243</link>
      <description>&lt;P&gt;What I would suggest is creating a series of named (PARAMETER) character constants for the symbols you want. You could then write them in formatted I/O using an A format.&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;character(2), parameter :: utf_degree = char(int(Z'C2'))//char(int(Z'B0'))
character(2), parameter :: utf_squared = char(int(Z'C2'))//char(int(Z'B2'))
character(2), parameter :: utf_cubed = char(int(Z'C2'))//char(int(Z'B3'))
open (unit=1,file='E:\new2.txt', form='formatted', status='unknown')
write (1,'(A,A)') "Degree: ", utf_degree
write (1,'(A,A)') "Squared: ", utf_squared
write (1,'(A,A)') "Cubed: ", utf_cubed
close (1)
end&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-08-23 141734.png" style="width: 173px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/18951i05ABCDD0754A49DC/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screenshot 2021-08-23 141734.png" alt="Screenshot 2021-08-23 141734.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 18:17:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309070#M157243</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-08-23T18:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309469#M157256</link>
      <description>&lt;P&gt;Thanks a lot. This is really helpful!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:36:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1309469#M157256</guid>
      <dc:creator>Jing1</dc:creator>
      <dc:date>2021-08-24T18:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311183#M157330</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;
&lt;P&gt;We are having trouble to use the same way to write these characters(fourth power, &lt;SPAN&gt;≤,&amp;nbsp;≥&lt;/SPAN&gt;) in FORTRAN to text file, because these characters' UNICODE(UTF-8) value has 3 bytes.&lt;/P&gt;
&lt;P&gt;Here is our test code:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;character&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;parameter&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;::&lt;/SPAN&gt;&lt;SPAN&gt; utf_fourth&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; char( int( Z'E2' )) // char(int( Z'81' )) // char(int( Z'B4' )) ! fourth power&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;open&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;unit&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;file&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'E:\new2.txt'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; form&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'formatted'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; status&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'unknown'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;write&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'(A,A)'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"Fourth: "&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; utf_fourth&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="token keyword"&gt;close&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="token keyword"&gt;end&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the test result is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jing1_0-1630434772261.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19106i50831DBF483EC271/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Jing1_0-1630434772261.png" alt="Jing1_0-1630434772261.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 18:33:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311183#M157330</guid>
      <dc:creator>Jing1</dc:creator>
      <dc:date>2021-08-31T18:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311194#M157332</link>
      <description>&lt;P&gt;Your test result doesn't match the program you show. When I compile and run the program, I get the proper "fourth" character.&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;character(3), parameter :: utf_fourth = char( int( Z'E2' )) // char(int( Z'81' )) // char(int( Z'B4' )) ! fourth power
character(3), parameter :: utf_lessequal = char(int(Z'E2')) // char(int(Z'89')) // char(int(Z'A4')) ! Less than or equal
character(3), parameter :: utf_greaterequal = char(int(Z'E2')) // char(int(Z'89')) // char(int(Z'A5')) ! Greaterthan or equal
open (unit=1,file='E:\new2.txt', form='formatted', status='unknown')

write (1,'(A,A)') "Fourth: ", utf_fourth 
write (1,'(A,A)') "Less or equal: ", utf_lessequal
write (1,'(A,A)') "Greater or equal: ", utf_greaterequal

close (1)

end&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-08-31 143543.png" style="width: 192px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19107iB66CF3589787EAD5/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screenshot 2021-08-31 143543.png" alt="Screenshot 2021-08-31 143543.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 18:37:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311194#M157332</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-08-31T18:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311255#M157341</link>
      <description>&lt;P&gt;Thanks for quick response, Steve.&lt;/P&gt;
&lt;P&gt;Sorry for the confusion, I uploaded the wrong screen shot.&lt;/P&gt;
&lt;P&gt;I copied your test code and ran it, why did I get this for fourth power? Any idea or guess?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jing1_1-1630450684917.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19112iFBE2A41B192507CB/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Jing1_1-1630450684917.png" alt="Jing1_1-1630450684917.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 23:03:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311255#M157341</guid>
      <dc:creator>Jing1</dc:creator>
      <dc:date>2021-08-31T23:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311390#M157343</link>
      <description>&lt;P&gt;I would guess because the font being used in your text editor does not have a definition for that code. I note that Steve opened in Notepad and you have some other program.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 09:01:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311390#M157343</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2021-09-01T09:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Write the Degree Symbol(UTF-8) to file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311452#M157344</link>
      <description>&lt;P&gt;Ah, that's Notepad++ which I also have. It defaults to Courier New font which doesn't have that character. Indeed, if I copy that character from Character Map and paste it into Notepad++, I get the block symbol.&lt;/P&gt;
&lt;P&gt;Do this. Settings &amp;gt; Style Configurator...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Language: Global Style, Style: Default Style. Change Font from Courier New to Consolas. While you're at it, you may want to change the font size from 10 to something larger (at least I did.) Save and Close.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-09-01 102241.png" style="width: 270px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19120i0FE62BACA71F01F3/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screenshot 2021-09-01 102241.png" alt="Screenshot 2021-09-01 102241.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 14:23:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Write-the-Degree-Symbol-UTF-8-to-file/m-p/1311452#M157344</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-09-01T14:23:38Z</dc:date>
    </item>
  </channel>
</rss>

