Feature request: UTF-8 source file support

 

I will be happy if MT4 supports UTF-8 source files.

Currently, MT4 build 6xx supports system locale codepage encoding and UTF-16LE.

UTF-16LE is locale-independent encoding, but has the following problem:

  • Some tools recognize UTF-16LE files as binary (ex. git).
  • Not only tools but also some of web services treat UTF-16LE files as binaries (ex. GitHub).

I hope MetaEditor supports UTF-8, additionaly, use it as default encoding.

To say again, UTF-16LE is not de facto.

 
micclly:

I will be happy if MT4 supports UTF-8 source files.

Currently, MT4 build 6xx supports system locale codepage encoding and UTF-16LE.

UTF-16LE is locale-independent encoding, but has the following problem:

  • Some tools recognize UTF-16LE files as binary (ex. git).
  • Not only tools but also some of web services treat UTF-16LE files as binaries (ex. GitHub).

I hope MetaEditor supports UTF-8, additionaly, use it as default encoding.

To say again, UTF-16LE is not de facto.

I have the same problem. Can't add my sources to git, it says that my .mq4 files are binary files. Even adding .gitattributes file doesn't help.. Does anyone have the same issue? Maybe there is a workaround?

UPDATE: Didn't find anything better and my quick workaround was: open mq4 in notepad++  and change encoding to UTF-8 (Encoding Tab).
 
micclly:

I will be happy if MT4 supports UTF-8 source files.

Please create an issue in the service desk and let us know how it goes. This is very important issue. Personally, I'm also interested in this feature.

As this is a MetaEditor problem, it affects both MT4 and MT5.

Meanwhile, could you please tell us which wide symbols do you use in your sources? Actually, UTF-16 is enabled (automatically) only if you use a non-latin symbol in the source. If it's an occasional symbol, you can remove it and get plain text.
 
iJSmile: I have the same problem. Can't add my sources to git, it says that my .mq4 files are binary files. Even adding .gitattributes file doesn't help.. Does anyone have the same issue? Maybe there is a workaround?
There must be something, since Metaquotes says GitHub now supports the MQL5 and MQL4 languages - General - MQL5 programming forum

 

I am stuffering the same problem as mentioned above. Git simply refused to Diff my *.mq4 files?

I tried Notepad++ solution and .gitattributes to no avail.

Can someone point me to a metatrader .gitattributes file in case i missed something?


Thanks.

 
jazzthedog:

I am stuffering the same problem as mentioned above. Git simply refused to Diff my *.mq4 files?

I tried Notepad++ solution and .gitattributes to no avail.

Can someone point me to a metatrader .gitattributes file in case i missed something?


Thanks.

i want to know also 

 
Jakeshbazi r: i want to know also 

It already supports UTF-8 and has done so for quite some time, but I don't remember since when.


 
Fernando Carreiro:

It already supports UTF-8 and has done so for quite some time, but I don't remember since when.


Thanks.  This helps.  I had not noticed this setting.  
 
Fernando Carreiro #:

It already supports UTF-8 and has done so for quite some time, but I don't remember since when.


Sorry to necro the thread.

As far as I can see, saving a mq4 file from metaeditor with the UTF-8 encoding selected actually results in a UTF-8 file with BOM (specifically EB BB BF) rather than a UTF-8 file.  Metaeditor will read a UTF-8 with or without a BOM correctly though as far as I can see.

As I understand it that's not ideal - according to https://en.wikipedia.org/wiki/Byte_order_mark:

BOM use is optional. Its presence interferes with the use of UTF-8 by software that does not expect non-ASCII bytes at the start of a file but that could otherwise handle the text stream


So fine if you stay within the MT4 universe but potentially problematic if you have a build process that involves sed or grep pre-processing.

 
LawrenceIpsum #:

Sorry to necro the thread.

As far as I can see, saving a mq4 file from metaeditor with the UTF-8 encoding selected actually results in a UTF-8 file with BOM (specifically EB BB BF) rather than a UTF-8 file.  Metaeditor will read a UTF-8 with or without a BOM correctly though as far as I can see.

As I understand it that's not ideal - according to https://en.wikipedia.org/wiki/Byte_order_mark:

BOM use is optional. Its presence interferes with the use of UTF-8 by software that does not expect non-ASCII bytes at the start of a file but that could otherwise handle the text stream


So fine if you stay within the MT4 universe but potentially problematic if you have a build process that involves sed or grep pre-processing.

What makes you think MetaEditor is using BOM for UTF-8 ? I just check (Build 2402 for MT4) and there is no BOM.

Out of curiosity, what is your use case for Sed/Grep on a mql source code ?

Reason: