473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2569
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.programmi ng' 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
4018
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
574
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 #--------------------------- #include <io.h> #include <ctime> #include <string>
2
3689
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 that it is not an integer, string or what have you?
0
1453
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: Requests...Request (1..n)... Payload (1)... PayloadCollection (1) ... Payload (0...n) I have the knowledge about the root object Responses which I can create directly. However I don't know what is the type for Request and Payload (These will be versioned...
8
2288
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. Regards Neil
15
2579
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 if BerConverter is supported for Win2000 server? http://msdn2.microsoft.com/en-us/library/system.directoryservices.protocols.berconverter.decode.aspx -- Thanks.
1
2420
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 = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; WORD-BREAK: break-all; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US...
2
7662
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 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)\r\n at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)\r\n at...
3
1459
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 EmpMainline class and I don't know how to fix it. It is in line 65 of my code. can't find symbol constructor Employee location class Employee. I would really appreciate any help on getting this to work. It may be my array. Our last class introduced us...
0
10578
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.