By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

How can I know if a string is BiDi string?

P: n/a
Hi,
I'm writing an application that gets a string as an input from the
user, and creates an image with this string.
The library that creates the image doesn't recognize if the string is
a right-to-left string, so in such case, I need to create a mirror
string.
How can I know if the string that I got from the user is in a BiDi
language?
Thanks,
Maya

Apr 12 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ma**@aoe6.net wrote:
I'm writing an application that gets a string as an input from the
user, and creates an image with this string.
What's "an image"? What do you mean by "an image"? Some kind of graphical
representation? C++ has no means to do graphics, you know that, right? And
it is probably irrelevant, I concede.
The library that creates the image doesn't recognize if the string is
a right-to-left string, so in such case, I need to create a mirror
string.
What's "a right-to-left string"? I know a "C-string", 'std::string', even
"a string literal".
How can I know if the string that I got from the user is in a BiDi
language?


What's "a BiDi language"?

You see, all those definitions do not exist in C++ language. If you need
to explain what you mean by those, it most likely makes your question OT
here because it has no answer in C++ terms. Perhaps you need to ask in
'comp.programming' or in the newsgroup that deals with your platform.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 12 '06 #2

P: n/a
ma**@aoe6.net wrote:
Hi,
I'm writing an application that gets a string as an input from the
user, and creates an image with this string.
The library that creates the image doesn't recognize if the string is
a right-to-left string, so in such case, I need to create a mirror
string.
From a data structure stand point a string of text of some
right-to-left languages such as Arabic need not be any different. It
does, however, require special handling in the printing system. Viz, the
text is stored as left-to-right and presented as right-to-left.

This is the case with most systems. I am not sure if your system is an
exception.
How can I know if the string that I got from the user is in a BiDi
language?
There are a few things you can do that relates to code pages and unicode
classification. But the detail can be better offered in other dedicated
newsgroups than this one. After all, it is not seriously a C++ Language
problem.
Thanks,
Maya


Ben
Apr 12 '06 #3

P: n/a
benben wrote:
After all, it is not seriously a C++ Language
problem.


One more tiny detail before the thread goes to another forum:

BiDi doesn't mean right to left text. It means left-to-right phrases, such
as "George W. Bush", flow left-to-right when nested inside right-to-left
phrases, such as Arabic. Or vice versa.

This effect makes editing GUIs real fun, when the cursor flows in the
opposite direction depending on text type.

To the OP: If you use Win32, reach out for the library called Uniscribe. It
supports these kinds of GUIs, so it will have the basic methods you need.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 12 '06 #4

P: n/a
ma**@aoe6.net wrote:
Hi,
I'm writing an application that gets a string as an input from the
user, and creates an image with this string.
The library that creates the image doesn't recognize if the string is
a right-to-left string, so in such case, I need to create a mirror
string.
How can I know if the string that I got from the user is in a BiDi
language?


The internal representation of a string has nothing to do with the
direction of writing on display or input devices such as user interface
text boxes and edit controls.

A non-empty string is an object which has a first character and a last
character. These positions are abstract; they are neither left nor
right. There is no such thing as a "right to left" string. (Or there
shouldn't be. Someone out there is probably working with data in this
naive way. There is no bottom to the stupidity in the computing field).

A string object could have a display attribute which indicates how it's
to be rendered. However, standard C++ strings are not required to have
any such attribute.

If you're working with some kind of UI tookit which has these strings,
find the forum where that toolkit is discussed.

Apr 12 '06 #5

P: n/a
Victor Bazarov wrote:
What's "a right-to-left string"? I know a "C-string", 'std::string', even
"a string literal".


A right-to-left string is an up-and-down string that has been rotated
90 degrees clockwise in memory. :)

Apr 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.