Problems with non-english sources

Created at 26 Aug 2014, 12:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AlexanderRC's avatar

AlexanderRC

Joined 04.02.2014

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


@AlexanderRC
Replies

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

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.

  1. Create a new Indicator/cBot.
  2. Edit in Visual Studio.
  3. In Visual Studio, add some Russian characters is string literals. Here is a string for you to copy and paste: (Русский язык)
  4. Save the file in Visual Studio.
  5. 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:58

Thank you for detailed explanation. We will fix this issue.


@Spotware