Russian text is not working in Android game when ported from iOS using Apportable SDK - android

I have successfully ported our game to Android from iOS using Apportable starter SDK.
I have come across a issue in which the device is decoding Russian text of the game , i have included screen shots and where i have given such Russian texts in xcode.As you see from the i have typed the word "Test" in English which is displayed properly and whereas the Russian text is displayed in some form of code.
NSArray *objects = [NSArray arrayWithObjects:#"\n Test Разъезжая по сказочным землям и устраивая веселые дискотеки, я добрался до Пушляндии. Я много слышал о веселых и дружных жителях этой страны - Пушистиках. Узнав о моем появлении, они шумной толпой прибежали на мою вечеринку..."];
Stack overflow is not allowing me to add screenshots so i am adding links.The first screenshot shows the way i want the text to display in android adb second screenshot shows the current way its displayed.
I will provide more detailed description or code if required.
Screenshot iOS: http://imgur.com/IX1ALye
Screenshot Android: http://imgur.com/oJmAoMO

Maybe i will be captain obviously it`s looking like file encoding error after port. Russian texts sometimes ussing cp-1251 encoding not utf. I hope i will help you to find solution.
P.s Sorry i dont have enought reputation to add comment so i post it like answer.

Related

Issue with float.Parse in Unity Android App

I develop an Android app. If I call
float.Parse("51.552058")
in Editor or App on my Mac Book (Language Setting English), it works fine. After publishing to Android (Language Setting German) the result of the Parse operation is not "51.552058" anymore but "5,155211E+09". I understand that this might be related to the device's language but I still don't really understand what is happening and why.
I also tried following with no success:
float.Parse("51.552058", System.Globalization.NumberStyles.Any)
float.Parse("51.552058", System.Globalization.NumberStyles.AllowDecimalPoint)
Did anyone stumble over this before?
float.Parse is culture dependent.
See e.g. from NumberFormatInfo
// '1,034,562.91' --> 1034562.91 (en-US)
// '1,034,562.91': FormatException (fr-FR)
// '1,034,562.91' --> 1034562.91 (Invariant)
Reason here is that in EU cultures the , is usually the decimal separator while the . is used as the group separator. So from the example above the correct format for fr-FR would be 1.034.562,91
You probably rather want to use CultureInfo.InvariantCulture like
float.Parse("51.552058", CultureInfo.InvariantCulture);
or directly NumberFormatInfo.InvariantInfo
float.Parse("51.552058", NumberFormatInfo.InvariantInfo);
which simply has defined
NumberDecimalSeparator .
NumberGroupSeparator ,

Obtaining a really really bad recognition using tesstwo

I'm trying to to implement OCR using these steps.
But the recognition of the words was really bad!
I tried to type "Apple" in a word and to capture it using the application
the output was "ADPIB"
and also I tried to capture " The quick brown fox jumped over the 5 lazy dogs"
and the output was --
THB QUECK DFGVVM F0X
IUFHPBCI 0VBF IHB 5
UBZV 00085
I tried the solution mentioned here, but nothing changed.

How to display source code "prettily" in android app

everyone.
[What I'd like to do]
To display source code "prettily" in android app. Like this.
At least if there are indents, it's fine.
[Why?]
Because I'm developing an android app where users can see Views and its source code at the same time.
[Issue]
Showing source codes on TextView looks ugly. A lot of escape characters needed for <> and the text layout collapsed. Googling and searching on Stackoverflow didn't give me any useful information.
Any help would be appreciated. Thanks!
(update 2015/11/23)
These link might be useful when you use WebView to display source codes.
- How can I display HTML source code within a HTML website? [duplicate]
- How to display source code with indent in a web page? HTML? CSS?
Displaying the text in a WebView is a great idea as you can now use javascript APIs like Google's Code Prettify
I believe SO uses it ;)
The comments in prettify.js are authoritative but the lexer should
work on a number of languages including C and friends, Java, Python,
Bash, SQL, HTML, XML, CSS, Javascript, Makefiles, and Rust.
It works passably on Ruby, PHP, VB, and Awk and a decent subset of
Perl and Ruby, but, because of commenting conventions, doesn't work on
Smalltalk, OCaml, etc. without a language extension.
Other languages are supported via extensions:
Apollo; Basic; Clojure; CSS; Dart; Erlang; Go; Haskell; Lasso; Lisp,
Scheme; Llvm; Logtalk; Lua; Matlab; MLs: F#, Ocaml,SML; Mumps;
Nemerle; Pascal; Protocol buffers; R, S; RD; Rust; Scala; SQL; Swift;
TCL; Latek; Visual Basic; VHDL; Wiki; XQ; YAML
I think this question is a tricky one. I tried to google myself and only find this library
https://android-arsenal.com/details/1/2049
which supports different text appearence. Hope this will help you out.

Cordova backspace cannot remove image in contenteditable div

I'm using Cordova 3.6.4 in Visual Studio 2013 Community Update 4 to build an apps with a "chat" functionality, the main reason that I use this technology is because I want to, hopefully, write once and can use it in all platforms such as Android phones, iPhones, all mobile phone browsers, all desktop browsers.
In order to let the users inputting the "message" to be sent, I create a [div] which is contenteditable="true" at the bottom left of the html, at the right hand side of this [div], I have two [image buttons], one is the [happy face] button, the other is the [send button]. (You know, just like Whatsapp, Line and WeChat!)
At any time the user can click the [happy face] button to select one of the many "face image" to insert into the cursor at the [div], then I'll add the html codes into the [div], e.g. div.innerHTML += '< img src="1.jpg">'
So, the innerHTML of this [div] can contain characters AND images, e.g.
12< img src="1.jpg" />34< img src="2.jpg" />
Of course, the actual display is:
12[1st Picture]34[2nd Picture]
If the cursor is at the end of this [div], and I clicked the [BACKSPACE], I expect the [2nd Picture] will be removed, if I clicked the [BACKSPACE] again, I expect the letter [4] will be removed from the [div], this is work at ALMOST every platform I mentioned including all mobile browsers in android and iphone/ipad, all desktop browsers. But it does not work when I build an Android app and run it in any Android phone.
Running it as a WebView in android phone, when I click the the [BACKSPACE], the letter [4] is removed instead of the [2nd Picture], when I click the [BACKSPACE] again, the letter[3] is removed. I can NEVER remove the 2 images no matter which IME I'm using.
To work around, I tried to add a keyup/keydown/keypress listener to the [BACKSPACE] but it never fires.
At last, to work around this [BUG], I need to add a third [X] image button and use JavaScript string.replace to remove the < img> tag when users click this [X] button, but it looks very stupid to the users!
It makes me crazy that ALL IMEs do not remove the image for me by pressing the [BACKSPACE], and if the key events are not fired, I cannot remove the images myself!
I tried ALMOST, I think, ALL the suggestions provided by stackoverflow but they don't work at all, either not applicable to CORDOVA, or with compilation error such as [command failed with exit code 8] in Visual Studio.
What should I do?

Android Arabic Language

I'm trying to make an app in Arabic Language for Android 2.2. I write a text to code such as:
البُرتُقال نوع من أنواع الحمضيات وهو مصدر ممتاز لفيتامين سي ويساعد فيتامين (سي) في البرتقال على امتصاص الكالسيوم في الجسم ، كما يحتوي أيضا على فيتامين أ كما أنه مصدر
it is displayed as below:
I mean the letters come separately, and that causes the meaning differences. How can I make the letters display connected?
Edit :
Yes 4.0 has the support for Arabic. Now I have to find a way for 2.2, because the product that I use, runs with 2.2. And I can't implement 4.0 to it easyly. Do you have any suggestion for that?
I found an issue report about Arabic language support. There was a post just 10 hours ago, that Android 4.x adds improved support for reading and writing BiDi text such as Arabic!
You need to use Arabic Reshaper utility
Below are the some links
https://github.com/agawish/Better-Arabic-Reshaper
https://mdictionary.wordpress.com/2011/02/10/connected-arabic-characters-for-android-apps/

Categories

Resources