How to display currency symbols in blackberry application? - unicode

i am not able to display some of the currency symbols like afghani("\u060B"), kip("\u20AD"), in blackberry application.
Am i missing something?

try to pass Unicode characters as char array instead of string:
add(new LabelField(new char[] { '\u060B' }));
Also, make sure you have specific font installed

Related

Write hebrew text to pdf using itextpdf

I'm trying to write Hebrew characters to a PDF.
I created HTML in the servlet by appending to a string buffer.
Then passing the same to xmlworkerhelper.
Also registered the arial.ttf, arialuni.ttf and arialbold.ttf fonts using XMLWorkerFontProvider and using the registered fonts in xmlworkerhelper.
Used the below fonts for registering arial.ttf, ArialBold.ttf, arialuni.ttf;
Any solutions for this issue will be very helpful. Let me know if more details required.
Below is the snippet.
XMLWorkerFontProvider fontImp = new XMLWorkerFontProvider();
fontImp.register(arial);
fontImp.register(arialbold);
fontImp.register(arialuni);
byte[] byte6=PDFtext.toString().getBytes("ISO-8859-1");
String bufferfinalPDF=new String(byte6, "UTF-8");
XMLWorkerHelper.getInstance().parseXHtml(writer, document, new ByteArrayInputStream(bufferfinalPDF.getBytes(Charset.forName(baseFont))),null,Charset.forName(baseFont),fontImp);
Solution or a suggestion on this is very helpful.

why the chinese words is chaos in monotouch/ios7

ios7/xamarin studio 4.3/monotouch7.2:
it's just a simply static method return the human-readable message, but why the chinese words is chaos in monotouch/ios7 ( in debug-watch window & iphone UI)
I have been attached the iPhone snapshot,
and uploaded the project solution file, pls download it from: http://pan.baidu.com/s/1o69G8xs
thanks for your help.
the source code is:
public static string GetMsg()
{
//btw, this file was edited in microsoft visual studio 2013
//and shared to mac to compile&debug
//(my business logic code is edit by vs2013)
return "Please input mobileNo, chinese words is(but incorrect to display):" + "请输入手机号";
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
string msg = TestLib.TestClass.GetMsg();
UIAlertView alertDialog = new UIAlertView("", msg, null, "OK");
alertDialog.Show();
}
UPDATE
It turned out to be the source file encoding (ISO-8859) versus UTF8.
The hint was that copying the code to another file made this work as expected.
ORIGINAL
I'm not sure for the Xamarin Studio debugger (it could be a different issue) but this should work in your iPhone user interfaces.
Have you included the additional I18N assemblies (in the project options) ?
If so the please file a bug report (and attach a sample app) so we can look why the UI does not show up correctly in your application.

KendoUI Window does not display Ciryllic characters

Our ASP.NET MVC application uses the KendoUI window control to display progress messages to the users. It works fine when used in languages with latin characters, but when setting the language of the web application to Russian, where the message should say something like
Составляем рапорт, пожалуйста подождите!
We get what is displayed in the image.
Is this an error or are we missing any configuration? I guess it could be something related to Unicode.
Thanks in advance.!
Late, but here is one way to do it: use the Raw method from System.Web.Mvc.HtmlHelper. Here is code for using it as an extension:
using System.Web;
using System.Web.Mvc;
namespace Web.Utils
{
public static class HtmlHelperExtensions
{
public static IHtmlString Resource(this HtmlHelper helper, string value)
{
return helper.Raw(value.Replace("\"", "\\\""));
}
}
}
Also quotes are preceded with a slash, in order to be safely used in Telerik control template.
Then extension can be used in code like this:
#(Html.Kendo().Window().Title(Html.Resource(your_string))

Using Java.util.scanner with GWT

for some reason when I try to use scanner with gwt, i get the following error:
No source code is available for type java.util.Scanner; did you forget to inherit a required module?
I looked around and it seems the "No source code is available for type xxxx" errors are due to not having a Javascript equivalent type for the Java type.
Is scanner not able to be used with GWT?
Here is a snippet of my code:
import java.util.Scanner;
...
public void submit(){
String text = editor.getEditor().getText();
Scanner input = new Scanner(text);
while(input.hasNextLine()){
String line = input.nextLine();
if(line.contains("//")){
cInfo.setDone(false);
cInfo.setCode(text);
return;
}
cInfo.setDone(true);
cInfo.setCode(text);
}
}
}
java.util.Scanner is not part of the GWT JRE Emulation. If you need a detail overview of what is inside the emulation here is the link to the docs:
https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation#Package_java_util
Your code (at least the one in the current version of your question) is probably[*] equivalent to
public void submit() {
String text = editor.getEditor().getText();
if ("".equals(text))
return;
cInfo.setDone(!text.contains("//"));
cInfo.setCode(text);
}
However, I have a feeling that this may not actually be what want to do (or is it?)
If you need to split strings on the client side, I usually recommend the Splitter class in Guava. Most of its methods are GwtCompatible, and (together with CharMatcher, Joiner, ...) it's great to use both on the client and server side of your Java code.
[*] assuming, that setDone and setCode are simple setters without side effects

Does GWT have richtextbox which show RTF type data?

I'm using GWT Richtextbox, But this widget shows values which are simple text or HTML formatted.
Is there any way to show RTF data in a GWT-Richtext or GWT-htmlEditor widget? Or is there a widget in other GWT libraries which will do this?
I don't think so. About year ago we wanted to develop rtf browser on client side and we failed.
There is no GWT-Rtf libraries. You could try to find something written in javascript and then wrap it with JSNI, but I haven't seen such library as well. Someone told me that it might be possible with Activex, but we haven't even tried this method.
What are you trying to achieve? If you want to share documents with an RTF editor like, say, Microsoft Word, you should check to see if that editor can also work with HTML. I know that MS Word can edit HTML.
Alternatively, you might consider transposing RTF into HTML and back again on the server side. There are several Java libraries out there for doing that, and I believe that Flying Saucer is one of them.
You could use RTFEditorKit in combination with HTMLEditorKit to convert between the two server-side or in an applet. This way you can use GWT's rich text editor and output or input RTF.
public static String getHtmlFromRtf(InputStream fi){
Writer sOut = new StringWriter();
DefaultStyledDocument doc = new DefaultStyledDocument();
HTMLEditorKit htmlKit = new HTMLEditorKit();
RTFEditorKit rtf = new RTFEditorKit();
try
{
rtf.read( fi, doc, 0 );
htmlKit.write(sOut, doc, 0, doc.getLength());
}
catch (IOException e)
{
e.printStackTrace();
}
catch (BadLocationException e)
{
e.printStackTrace();
}
return sOut.toString();
}