I have a dual-language MVC3 application which needs to display errors in Arabic.
I can put the model validation in place as per normal, however for one of my error messages there is an accent character which translates to ".
As soon as I try and add an escape character \ it messes up the string!?
[Required(ErrorMessage = "خطأ: يجب أن يكون رقم الحساب مكونا" من 13 رقما")]
Any idea how to escape this to allow the accent character to be correctly displayed?
In an LTR language, how do you escape a string delimiting character when your coding language is RTL?
I can only repeat Jukka's comments: there shouldn't be a problem here. You put the backslash logically before the double-quote, which in this case means it appears to the right of it in editors that support bidi text:
[Required(ErrorMessage = "خطأ: يجب أن يكون رقم الحساب مكونا\" من 13 رقما")]
This works fine for me in VS 2010 (although the cursor controls don't match what you might be used to in other apps whilst editing it).
There is an Arabic accent character that is a " (double quote)
Whilst my knowledge of Arabic is minimal, this seems unlikely. Are you looking for the combining diacritical U+064B Arabic Fathatan? (مكوناً)
Related
I am trying to create multi line hint in my application made in delphi 10 seattle (FMX). seems like line break is not working while setting the hints.
Button1.Hint := 'Line 1' + #13#10 + 'Line2';
Any idea about how this can be done. this is working fine in VCL though.
please check if your button has ShowHint property checked.
Button1.Hint := 'line 1' + sLineBreak + 'line 2';
I can offer a hint that I just worked through the same type of problem in C++ Builder Rio. I don't have Delphi, just C++ Builder, but the two products are so inter-related, I use hints (or code) from Delphi all the time to solve my problems.
In C/C++, you can generally use "\r" or its equivalent "\n\l" to display a carriage return (which I was trying to display in a TMemo). The TMemo looked like it was just stripping out the codes (except it thought the "\l", for line-feed, was an invalid escape code, so it would display just the "l") and was displaying everything on one line. I did notice the shortcut for tab ("\t") was working.
Again, in C/C++, there are other options for how to create characters. The equivalent of what you are doing, "char(13)+char(10)" just displays the characters "23" with everything on the same line (as you are describing). That is how one add characters when you are using decimal (base 10). If I wanted to use hexadecimal, I would write "\0xd\0xa" (which just gets stripped out of the text and displayed on one line, like the stuff in the second paragraph above).
The solution that I found that worked in C++ Builder was to use an octal notation for my character encoding ("\015\012"). Personally, in about 50 years of programming, I have never previously seen a situation where hexadecimal failed, but octal worked, but I was desperate enough to try it.
For all this testing and debugging, I created a new project, added a TMemo and a button (and set ShowHint=true for the button) to the form and put the following in for the code for the button:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
UnicodeString CR = "\015\012";
Memo1->Text = "a" + CR + "b";
Button1->Hint = Memo1->Text + " (hint)";
}
So, my solution to your problem is figure out how you can put octal codes in for characters and display the corresponding text in Delphi, then use that encoding for the octal characters "015" and "012".
I want to have Diacritical r in my wygwam editor's special character list. I have some special characters at the moment but not Řř. Can anyone tell me how to enable/add this please?
Current special character list
Thanks.
I need to insert the ® character as a superscript into the title bar of an app for the iPad. How can this be done in XCode?
As of iOS 5.x, you can't set text attributes like bold, superscript, etc. on individual characters within a label's text. (This includes the builtin labels of navigation bars.)
You can just insert the ® character in your string (you can type it on a US Mac keyboard with option-R, or use the escape code as in Jessedc's answer). Whether it appears small and superscript depends on the font used for the label -- some fonts make that symbol appear as such already, others make it larger and baseline-aligned.
Grab the unicode character
put it in a string
NSString *string = #"\u00AE"; //this is your (r)
Nearly a duplicate of How do I escape a Unicode character in my Objective-C source code?
I get some text string from service, which contains Unicode control characters
(i.e \u202B or \u202A and others for Arabic language support).
But while debugging I can't see them in default text visualizer. So I need to enable display for such characters to determine which of them my text consists of. There is checkbox in text visualizer "show all characters", but it doesn't work as I expect.
Any suggestions?
Thanks in advance
Those are codes for explicit RLE and LRE order, ie if in RLE something should be displayed in LRE order.
http://unicode.org/reports/tr9/#Directional_Formatting_Codes
I can use VIM to input these color control chars by "Ctrl-V, Esc" then it will show me ^[ as a special leading char for color control chars sequence.
How could I do this in Textmate?
Thanks
You can select those from the character viewer (Menu Edit -> Special Characters, then search for 'escape'), but I think you'd be better off using an escaped form of that character, e.g. \033 in Bash or \x1b in PHP. That, of course, would depend on what kind of document you're editing.