Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
Mike896
Total Points:
1,280
Status Points:
0
Brown Belt
November 11, 2008 11:29 PM PST
UTF-16 is not supported

Hi

I have this error:

>fortcom: Severe: Source file format UTF-16 is not supported. Convert to a supported format.

, after I copy some messages (some Chinese and also some Russian codes inside I guess) from my email (I comment them).

I restore it, however, I still have this error.

Even I delete them all, I still have this error.

It is very very weird.

 

Mike

Mike896
Total Points:
1,280
Status Points:
0
Brown Belt
November 12, 2008 4:38 AM PST
Rate
 
#1

Quite silly to reply to myself.

I finnaly edit a new file and copy my original file step by step.

And it works.  Until, I don't know why.

 

Mike



Mike896
Total Points:
1,280
Status Points:
0
Brown Belt
November 12, 2008 4:43 AM PST
Rate
 
#2 Reply to #1

I find the sizes of two same file (one is copied by the other) are different.

One is 41 k, and the other one is 21 k.

It must have something inside and invisible.  :)

Mike



Jugoslav Dujic
Total Points:
6,542
Status Points:
6,542
Black Belt
November 12, 2008 4:55 AM PST
Rate
 
#3 Reply to #1
Quoting - Mike896

Quite silly to reply to myself.

I finnaly edit a new file and copy my original file step by step.

And it works.  Until, I don't know why

UTF-16, also known as "wide characters", or simply but imprecisely as "Unicode", is character encoding where 2 bytes are assigned to every character (as opposed to common, "ASCII" or UTF-8, or other types of encoding, where 1 byte is assigned). With UTF-16, you can get 65536 different letters simultaneously, but at the obvious cost of using twice as much space. Fortran compiler (like many others) doesn't like UTF-16 encoded files, as it said.

Much of the underlying OS infrastructure in Windows is, actually, based on UTF-16. When you copy/paste text between Unicode-aware and unaware applications, lots of conversions take place and strange things occasionally happen.

What probably happened is that you pasted some UTF-16 encoded text from the web page, Visual Studio recognized that your file now has a wider range of characters than 256 and automatically saved it as UTF-16 (or asked, but you didn't pay too much attention).

In the Save As dialog of Visual Studio 200x, there's option "Save with Encoding", hidden below the arrow attached to the "Save" button.

 


--------
Jugoslav
www.xeffort.com


Mike896
Total Points:
1,280
Status Points:
0
Brown Belt
November 12, 2008 5:16 AM PST
Rate
 
#4 Reply to #3
Quoting - Jugoslav Dujic

UTF-16, also known as "wide characters", or simply but imprecisely as "Unicode", is character encoding where 2 bytes are assigned to every character (as opposed to common, "ASCII" or UTF-8, or other types of encoding, where 1 byte is assigned). With UTF-16, you can get 65536 different letters simultaneously, but at the obvious cost of using twice as much space. Fortran compiler (like many others) doesn't like UTF-16 encoded files, as it said.

Much of the underlying OS infrastructure in Windows is, actually, based on UTF-16. When you copy/paste text between Unicode-aware and unaware applications, lots of conversions take place and strange things occasionally happen.

What probably happened is that you pasted some UTF-16 encoded text from the web page, Visual Studio recognized that your file now has a wider range of characters than 256 and automatically saved it as UTF-16 (or asked, but you didn't pay too much attention).

In the Save As dialog of Visual Studio 200x, there's option "Save with Encoding", hidden below the arrow attached to the "Save" button.

 

Hi, Jugoslav

Yes, you are right.

After I save it as (using Advanced Save Options) "Unicode (UTF-8 with signature)", the program is ok now.

Now I can keep on doing my job.

Thank you very much indeed.

 

Mike





Intel Software Network Forums Statistics

8289 users have contributed to 31235 threads and 99109 posts to date.
In the past 24 hours, we have 7 new thread(s) 24 new posts(s), and 30 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member Michael Johanson