AngularJS Forms and I18N support - not reading Japanese characters - forms

A quick question regarding Angular Forms and Japanese characters. Am using Angular 1.2.17, and modern Chrome web browser on Mac OSX (latest).
Am writing an AngularJS application for Japanese market. Everything works great displaying Kana etc on the HTML pages etc. There are no issues with the web server, or Database etc, UTF8 support is throughout the application.
However, for the AngularJS forms, it does not read the Kanji / Hiragana / Katakana unless the word or sentence starts with latin character. Angular $scope appears to be unable to distinguish the fact that the JP characters have been typed at all unless prefixed with a latin character.
Example:
こにちわ does NOT register when typed into the input field, and hence form validation fails because it will think a required field is empty.
Whereas:
adsfこにちわ does register and the form can be submitted successfully. End to end, the JP characters are handled correctly, and get stored into DB correctly. So Angular / JS is parsing the UTF8 text correctly. The issue is likely something to do with how Angular binds to the data ($scope) when only JP characters are provided. It doesn't handle this properly by default.
Does anyone know of any HTML or Angular configuration etc - required Angular module or params, meta tags etc etc, that would coerce the Form to behave properly. Have not tested, but am pretty certain this issue is not specific to JP characters - it is likely anyone working with a non latin alphabet might have experienced the same behaviour.
Must be missing something obvious here.
Thank you for any help at all!

OK, updating this question very late - actually solved it very shortly after asking.
This turned out to be a timewaster question. Apologies.
But if anyone should come across a similar problem then please check for any REGEX declarations in the Form fields. For instance, a ng-pattern="/^[a-zA-Z]/"
Yes, this will do what it says, and exclude Kanji. Surprisingly it does NOT then put helpful validation error on the form field so from UI perspective it appears that the foreign language characters simply weren't registered.

Related

Adding &js_fast_load=0&css_fast_load=0&strip=0 to URL triggers mojibake

I have a Liferay 6.2 page that shows fine.
For debug purposes, I added &js_fast_load=0&css_fast_load=0&strip=0 o the URL (production server that I can not modify).
Problem: By doing so, the page's encoding gets mixed up (mojibake)
What could be triggering the problem, and how to solve it?
I don't know what is the root cause of the problem.
But as it is for debug (these URL parameters are only used for debugging), an easy way to "solve" it is to manually switch the page encoding to UTF-8.
Any better solution is very welcome!
You mention in your own answer that switching to UTF-8 fixes the issue. I'd add to it that this issue points to a general problem with encoding on some level. I always recommend to always strictly and everywhere standardize on the same encoding: From Database/Filesystem/appserver to the HTTP/HTML layer. Mixing up encoding is a recipe for disaster, mainly because it will only be detected in edge cases unless you happen to work in non-latin character sets routinely.
My favorite way to test with non-latin character sets that make sense to you when you only speak languages that use latin alphabet is to utilize http://fliptitle.com to generate test data. If that goes through, odds are that all of your configuration is correct.

How to remove special characters from URL permalinks

I am starting with jekyll and i'll appreciate any kind of help.
I am making a blog site but not in english language.
Default language will be Czech so in post tittles there will be characters like ĚŠČŘŽÝÁÍ.
I want to use pretty permalinks with post tittle in it, but actualy it doesn't work
properly in Safari browser. I am getting error 500 from server.
How to resolve it? Is there any plugin which can convert these characters in ascii symbols escrzyai and how to install it?
I believe permalinks are determined by settings + post file names, not settings + post titles.
So you should have files names like
_posts\2014-04-12-hello-world.md
instead of
_posts\2014-04-12-je-každoročně-tak-veliký.md
Inside the post, you can still use post title in Czech.
Permalinks' documentation is here, note if you have Czech categories and you use them in permalinks, you will still get into trouble, so it's better to avoid Czech categories in permalinks.

Is it possible to customize Recaptcha image language?

Is it possible to customize Recaptcha to display text in English only words?
As recently, I found that text could be displayed in other language like Hebrew.
Here is example:
To be honest it is not possible to type such words for ordinary users having keyboard with Roman alphabet and not many know that image can be redrawn.
AFAIK, via the API you may only customize the interface, not the images.
reCAPTCHA uses scans from the real books, so sometimes, even in latin books there are some non latin characters too.
But there should be no problem here. reCAPTCHA displays always two words: one unknown even for the reCAPTCHA (probably the Hebrew in this case), and the other one, which is really checked.
So the user may misspell the Hebrew, but it's OK when he types the other one (latin) word as expected.
(Only guesses, but I think that's how this thing works).
Have you looked at: http://code.google.com/apis/recaptcha/docs/customization.html#i18n?
That's the API. It talks about setting the translation, but I've never used it, so I'm not 100% sure whether it can do what you want.
Due to where Recaptcha gets its captcha string from (text scanned from books), it could very well be limited to languages that use the Latin alphabet.
I bet that Reviled is the challenge word (the one scanned from the book) and the other is the test word (the one it uses to verify whether or not the person who typed the challenge word is actually typing something legitimate or not).

Sanitizing title URLs in ExpressionEngine 1.6.x

I run a blog where the blog title is either an external link or an internal link to a longer piece similar to what you’ve seen on similar blogs. For some reason, ExpressionEngine (1.6.x) does nothing to sanitize such things as ampersands in the URLs provided.
I use Markdown in the body text, which seems to do a great job of sanitizing all URLs. Yet, ExpressionEngine’s own handling of the titles doesn’t cut it. I have tried formatting the “title URLs” in Markdown and failed miserable, and damn if I know what the hell it is in ExpressionEngine that prevents me from using it.
So the question boils down to what other ExpressionEngine 1.6.x users do and have done, or whether someone can come up with a MacGyver-esque solution. Because I’ve been stumped upwards of half a year.
The XML Encode Plugin for EE1 from Rick Ellis of EllisLab will convert your special characters to HTML entities.
The plugin was originally designed to convert reserved XML characters to HTML entities in the ExpressionEngine RSS templates, but should work for what you need.
To use the plugin, wrap your {title_link} custom field in between its tag pairs:
{exp:xml_encode}
{title_link}
{/exp:xml_encode}
This would result in:
http://www.google.com/search?q=nytimes&btnG=Google+Search
Being converting into:
http://www.google.com/search?q=nytimes&btnG=Google+Search
Other EE1 Plugins which offer more similar but advanced features are Cleaner by utilitEEs (Oliver Heine) or Low Replace by Lodewijk Schutte.

Joomla 1.5 & Indic Unicode Fonts - How-to?

I am using Inscript Keyboard to directly type into TinyMCE. However when I click on save, all the characters appear as question marks on website and even in article list on admin side.
How I should solve the problem?
I am specifically talking about Marathi but the problem-solution might be same for all Devnagrari fonts.
Thanks in advance.