473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How can I know if a string is BiDi string?

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
5 2545
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mylinux | last post by:
program was taken from http://www.beyondlogic.org/parlcd/parlcd.htm when compile under rh 9.0 I do not know how to correct this error. can u help? there is dos.h in my linux box.
1
by: wukexin | last post by:
I write my own class Cfile, I want to know what about implement ctime().Who help me? My use function ctime, I sign it with $$$. my class Cfile: #------------------------ file.h...
2
by: Tom | last post by:
In C, I can just read the K&R book and know how everything is pretty much coded at the machine level. At least to some extent. But how does Perl know when you type print $ref for example...
0
by: raca | last post by:
I am trying to create a generic SOA ServiceInvoker that will accept an XML string that will be used to deserialize an object generated by XSDObjectGen. The hierarchy goes like this:...
8
by: Neil Rowe | last post by:
Hi all I am writing an App at the moment and I need to be able to download & Upload xml files from an ftp server. Does anyone know how this can be done without using a third party component. ...
15
by: Pucca | last post by:
I'm getting an error when I tried to use this BerConverter class in my C# code. Even though the Interent doc says that it runs on Win2000 sp4, I just thgouth I'll double check. Does anyone know...
1
by: guozhen | last post by:
hey.I got a problem I want to parse the string below with regular expression ¡°1¡¢¾«Í¨»ùÓÚJ2EE¼Ü¹¹µÄJavaºËÐÄÓï·¨¡¢Java±à³Ì£¬3ÄêÒÔÉÏÈí¼þ¿ª·¢»òÅàѵÏà¹Ø ¹¤×÷¾­ÑéÕߣ»<?xml:namespace prefix = o ns =...
2
by: Dan Holmes | last post by:
I don't know how to troubleshoot this one. src is after the error. "System.Data.SqlClient.SqlException: XML parsing: line 1, character 698, illegal qualified name character\r\n at...
3
by: jlgraham | last post by:
This is the first course I have ever taken in any programming language. This is my last assignment and totally frustrated. My employee class compiled but get 1 error when I tried to compile my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.