How to show backslash in Japanese

In my application, I used a backslash as part of a text activity indicator (typical / - \ sequence .. I deleted | because I had a different width). Everything was fine until I saw that my application was running on a Japanese computer. The backslash has been replaced by a Japanese character.

How can i avoid this?

+4
source share
6 answers

In the delphi application, you can choose a font that displays this Unicode code as a backslash. However, most standard fonts, including many on Windows, will intentionally display the Yen sign instead of the backslash in Japanese locations, because users expect it.

If you want to be sure of what is shown, use your own font, which does not come with windows, and install it with your application.

+1
source

You can use .oOo as a sequence. period, small o, capital O, small o.

which should work in any language.

+2
source

You just need to live with it. Editing things like shell scripts on a Japanese computer looks weird, but you get used to it. Especially if your application works remotely through an SSH session or something like that, you won’t be able to control which fonts will be used to render it.

It’s best to use more attractive characters, such as ╱─╲ or something like that, and hope that the user has a font that can show it.

0
source

Finishing the switch to Unicode with the newer version of Delphi, you will need to find a low ASCII character set that can make a suitable animation.
I would suggest using the number sequence [0-9] or [1-3] to stay with 3 characters. This should work with all Japanese code sets.

0
source

If Unicode fonts on a user's computer support it, you can also try harakura of one of these Unicode blocks:

http://en.wikipedia.org/wiki/Arrow_%28symbol%29

http://en.wikipedia.org/wiki/Box_drawing_characters

http://en.wikipedia.org/wiki/Unicode_Geometric_Shapes

http://en.wikipedia.org/wiki/Miscellaneous_Technical_%28Unicode%29

http://en.wikipedia.org/wiki/Miscellaneous_Symbols

(VCL only, for console applications, the problem is the character set / shell code page)

But that sounds promising (except for the part of the font that might get out of hand):

Writeln in Delphi 2009 still uses ANSI (see System TTextRec), but you can use UTF8Encode and change the console code output page to UTF8 by calling SetConsoleOutputCP (CP_UTF8). You will also need a good font to display Unicode characters.

(From fooobar.com/questions/228761 / ... )

0
source

Hold Ctrl + ` and it should change.

-2
source

Source: https://habr.com/ru/post/1394293/


All Articles