0

i want the output from my c++ progrmm to be typed in right to left in the console , i couldn't find and console api function that can help me ( the output is in arabic language this why i want type RTL.

Ibrahim.Sluma
  • 164
  • 13

1 Answers1

1

Visual Studio can display Arabic and Hebrew text correctly from right to left.I suggest you could refer to MS DOC

Firstly:

In order to enter and display bidirectional languages, you must be working with a version of Windows that is configured with the appropriate language. This can either be an English version of Windows with the appropriate language pack installed, or the appropriately localized version of Windows.

I suggest you should set the code page to Arabic code page, or utf8, on your Arabic computer. On non-Arabic computers, it will be difficult to find a console font that can display glyphs.

And then:

Visual Studio has limited support for right-to-left reading order. By default, text-entry controls in Visual Studio use left-to-right reading order. In most cases, you can use standard Windows gestures to switch reading order.

You could try to press Ctrl+RightShift to switch the Properties window to support right-to-left reading order for property values.

The code editor (and text editor) does not support right-to-left reading order. You can enter text in a bidirectional language, but the reading order is always left-to-right.

As far as I'm concerned, the console does not support Right-To-Left languages.

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20
  • that will work for doc, im talking about the cmd ! i want to make it rtl – Ibrahim.Sluma Dec 22 '19 at 18:45
  • For more details I suggest you could refer to the link:https://stackoverflow.com/questions/21751827/displaying-arabic-characters-in-c-sharp-console-application/21753872#21753872 – Jeaninez - MSFT Dec 23 '19 at 05:51
  • i've already fixed all the problems that faced me with the print arabic ( even the real shape of arabic word ) and i've reverse the output like this man did in this topic , but i want to make the console in rtl so i don't have to reverse the word . thats my whole question about . – Ibrahim.Sluma Dec 23 '19 at 13:59
  • **"i want to make the console in rtl"** If you want to align text to the right in the C++ console? If so,I suggest you could refer to the [link](https://stackoverflow.com/questions/3824696/aligning-text-to-the-right-in-the-c-console). – Jeaninez - MSFT Dec 24 '19 at 03:15
  • i've seen it before that will align text to the left but still will type it LTR not RTL . – Ibrahim.Sluma Dec 24 '19 at 11:21
  • As far as I'm concerned, the console does not support Right-To-Left output. You could try to use [SetConsoleCursorPosition function](https://learn.microsoft.com/en-us/windows/console/setconsolecursorposition) to set the cursor position to the far right in the specified console screen buffer. When you enter a character each time, you need to move the cursor one character to the left. – Jeaninez - MSFT Dec 26 '19 at 06:45
  • but that will only go to pos and still the output will be in left no in right – Ibrahim.Sluma Dec 26 '19 at 13:10
  • The console does not support right-to-left output directly. We could implement this function indirectly by writing code that moves the cursor position during output. – Jeaninez - MSFT Dec 27 '19 at 02:04