Problems with non-english sources
Problems with non-english sources
26 Aug 2014, 12:26
I have a problem with Russian characters in cAlgo. In Visual Studio 2010 Russian characters are shown without any problems. In cAlgo, the same source file is interpreted as being Unicode when in fact it is in cp1251 encoding. When I save the file from Visual Studio using Save As and set encoding to Unicode (UTF-8 with signature), cAlgo starts to show the source properly.
I believe the VS addon should be fixed to generate projects with source file(s) marked as Unicode (UTF-8 with signature).
Here are the screenshots
Replies
AlexanderRC
27 Aug 2014, 15:36
( Updated at: 21 Dec 2023, 09:20 )
Here is how my locale for non-Unicode (single byte string) programs is set. Visual Studio 2010 seems to pick it (cp1251) as a default when saving source files if non-ASCII characters are added first in Visual Studio.
Steps to reproduce.
- Create a new Indicator/cBot.
- Edit in Visual Studio.
- In Visual Studio, add some Russian characters is string literals. Here is a string for you to copy and paste: (Русский язык)
- Save the file in Visual Studio.
- Go back into cAlgo and observe the garbled characters.
The problem is that Visual Studio saves the file in cp1251 encoding if the file is pure ASCII (new Indicators/cBots are). If I add some Russian characters in cAlgo first and save, cAlgo saves it as UTF-8 without bytemark. If I later edit such a file in Visual Studio it properly detects the file as being UTF-8 (due to double byte character sequences of Russian characters) and saves it as such. The most unobtrusive fix would be to add Unicode bytemark at the beginning of the source file.
@AlexanderRC
Spotware
27 Aug 2014, 15:08 ( Updated at: 21 Dec 2023, 09:20 )
Unfortunately, we cannot reproduce this problem. You can try to change system language for non-Unicode programs:
@Spotware