How are non left-to-right top-to-bottom languages handled in the computer?

For instance I can’t imagine vertical Japanese looks like

<character> <character> <character> … <character>

<character> [etc…]

(where is tab and
is newline)

I imagine there must be a better way to handle it, does the font or encoding or something dictate how it’s displayed (let’s say I want to write an HTML page in vertical right-to-left Japanese because it’d be cool – or I want my notepad documents to be right-to-left Arabic), or are you pretty much SOL writing differently-oriented languages without a program specifically designed to format text (or designed from the ground up for that writing style) like a LaTeX interpreter or Word? In other words, I guess, is there a way to set an environment so that, say, naturally ’ ’ and ’ ’ are downward vertical spaces and ’
’ is a leftward horizontal space?

ETA: Damnit, non-left-to-right top-to-bottom, I’m reporting so a mod can fix it

I don’t know how they are “hsndled” but I do know that for Urdu, a right to left language, you need special typists to type so

Top-to-bottom Japanese is not frequently used on websites or in computer-based literature. In the few situations where it is used for creative/artistic purposes, there’s no special technology for it, the author will make use of a variety of rendering/formatting techniques available in his chosen medium to display the text.

However there are numerous methods available for right-to-left languages, including HTML tags and Unicode character codes that indicate that a line of text is meant to be displayed right-to-left rather than the default left-to-right.

I used to do IT support work at a Japanese owned company and the pc’s were the same but everything was in Japanese and they used a Kanji keyboard for their characters.

And, as cc above pointed out, html rendering of right to left is no big deal.

I have seen a demonstration of an Israeli library catalogue system that mixed Hebrew with Latin characters without any problems. It looked a bit strange, though, with some text from left to right and some from right to left on the same screen.

When I was in Japan, I saw a lot of left to right text. The Japanese seem quite accustomed to that and vertical text may be relegated to artistic endeavors (I duck the opprobrium that is about to descend on me). They use a system of inputting a roman approximation to the Kanji and the software either interprets it directly or gives you a choice of a few Kanji and you choose. It sounds cumbersome, but I guess you get used to it.

As for right to left languages, I don’t see any problem. You need a right to left input processor, but that is just a piece of software. More complicated, is the mixing of right to left and left to right in the same document. Especially if there are line breaks involved. I’ve never used it, there is a variation of tex (tex is my native language) called xetex that automates all that. In that case you use left to right input (so you have to reverse the other language in your head), indicating when you change languages/directions, run it through the xetex engine and, voilà, there it is, including sensible line breaks.

Now that sounds really mixed up. Is it easy to learn to manage in?

I’m pretty sure the way this sort of thing works is that you hit some key combination that switches to the other language, and then it comes right-to-left instead of left-to-right (or vice versa). It looks akin to a mirrored version of what it looks like when you type with right alignment, with the cursor remaining still while the characters keep moving to the right.

I base this on my experience using Wikipedia–they often have an original language word, where that language is right-to-left. See Hebrew alphabet article for example. Try editing it using the advanced editor to see what I’m talking about.

Or, heck, try the advanced editor here on the first sentence: “The Hebrew alphabet (Hebrew: אָלֶף־בֵּית עִבְרִי‎‎, *alefbet ʿIvri *) known variously by scholars as the Jewish script, square script, block script, or more historically, the Assyrian script, is used in the writing of the Hebrew language, as well as other Jewish languages, most notably Yiddish, Ladino, and Judeo-Arabic.”

Top-to-bottom languages are invariably rendered left-to-right. (Japanese being the most common example.) Nobody’s confused by this.

For right-to-left languages, there’s a Unicode characters that change text direction (200f for right-to-left, 200e for left-to-right). It’s hilarious to use in English. Alas, this forum doesn’t seem to allow it…

When Japanese is written top-to-bottom, then it’s written right-to-left. When Japanese is written horizontally, it’s written left-to-write.

Office and many other programs now handles it nicely with a simple setting which allows you to do it. Before Windows because really popular, Japanese mostly used word processors which had that ability to make that setting. I don’t remember what my old DOS V machine did, or if I ever tried to write vertically on it.

I’m perfectly aware that Japanese (and other top-bottom) languages just go left-to-right style, I was mostly just wondering if there was anything like the unicode character mentioned for right-to-left that would, if for some bizarre reason I chose to, be able to type something top-to-bottom style.

Apparently not.

I had to set up a computer to use Arabic. It was years ago – probably the computer was Windows 98. You had to get an Arabic keyboard, but other than than you simply changed the computer language to Arabic and everything typed right to left.

…also a computer doesn’t have to understand anything about the language at all, it simply has to simply display it, starting from whatever corner you want.

Now if we were talking about VT100 terminals then displaying non-left-right-top-bottom languages requires a lot of extra control codes to display (though I think the Wyse 520 allowed you to simply tell it start off from the right…maybe they had more Asian customers).

Right, but depending on the instructions on how to interpret characters

‘a’<space>‘b’<newline>‘c’ Could be displayed as

(ltr)


a b
c

(rtl)


b a
  c

(top-to-bottom)


c a
  b

Or any number of other ways. I was mostly asking if there was some sort of standardized way to instruct the computer to treat spaces, character order, and newlines differently. The text is still going to be “at address ‘x’ is this character, at address ‘y’ is this other character.” I didn’t know if there was some instruction, character, encoding, whatever that controlled what corner ‘x’ started in, and where ‘y’ would be placed in relation to that, what direction does a newline space in? Down from ‘x’? Left from ‘x’?

Apparently, as mentioned above, there IS a unicode character that tells the machine to treat the starting character as beginning in the upper right hand corner and each successor character to be placed to the left of the previous character, where newlines are spaces that space downwards. I didn’t know if there was a similar instruction, character, or whatever that would, say, specify that the first character is in the upper right hand corner, with each successive character being placed below the previous, with a newline making a space to the left.

ETA: Obviously I’m ignoring spacing subtleties like kerning and whatnot, but I think that’s controlled at a much higher level in the font unlike the basic default layout of text. I could easily be wrong though, I’m not too familiar with how low-level IO works.

To expand on what others have said, here is the text orientation option for the Japanese version on Microsoft Word 2010.