[feature-bug request] Correct diacritics for Romanian

This is a combined feature-bug request, and, ironically, it’s due to Microsoft’s error.
Problem: Windows 95, 98, 2000, 2003 server and XP are unable to display the correct diacritics for Romanian language. Instead, these versions were projected to use some Turkish diacritics. The correct diacritis in Romanian are [ș, Ș, ț, Ț]. The incorrect diacritics are: [ş, Ş, ţ, Ţ]. In all fonts, correct characters are not defined. Microsoft was unable to correct the problem, so there is no patch.
If a user running, for instance, Windows XP, is visiting a website containing ș, Ș, ț, Ț, these characters are replaced by small rectangles, like the one in file error1.png. Also, when filling in a form, the user will type the incorrect characters, because the keyboard layout is wrong.
Possible Solution: If config.i18n.default_locale is :ro and the browser’s operating system is not Windows NT or is Windows NT prior to 6.0 (Vista), then Rails should:

  1. replace [ş, Ş, ţ, Ţ] with [ș, Ș, ț, Ț] if the request is POST
  2. replace [ș, Ș, ț, Ț] with [ş, Ş, ţ, Ţ] if the request is GET
    These 2 replacements should be applied not only to request/response’s html body, but also to the URL.

The browser’s operating system can be checked from HTTP_USER_AGENT. Old versions of Windows are not coded ‘NT’. The problem applies also for versions of Windows coded ‘NT’ prior to version 6.0 (Windows Vista).

Sidenote: Wikipedia is the only website I know to address this problem: http://ro.wikipedia.org/wiki/Wikipedia:Diacriticele_vechi_și_noi

error1.PNG

Can this be done by using a middleware? If so, I’d say you could start a gem that injects this into middleware stack.

While I see that this error is legit, I don’t think the fix will be in Rails Core because the core team (that I don’t think anybody knows Romanian) would be suitable to maintain this set of functionality as they’d never use it.

Let me know if you need some help to find the place to plug in.

Thanks,

Prem

I don’t know if I’m the proper person, because I’ve never created a gem before.

I’m an intermediate Rails programmer (more beginner than intermediate).

Also, I don’t know much about middleware in Rails.

Please advise.

Regards,

Nicolae

vineri, 7 noiembrie 2014, 09:26:26 UTC+2, Prem Sichanugrist a scris: