home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
WebEPG and proper Title-casing in Greek
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="arion_p" data-source="post: 161670" data-attributes="member: 45945"><p>Hi james,</p><p></p><p>I tried your code this morning but it didn't work. I also remember reading some article about Greek Final Sigma special casing rules in Unicode. According to the article the special casing rules where initialy included in the Unicode draft but later on they where dropped to avoid complexity. However the current version of Unicode includes those rules. Anyway it seems the NET team decided not to implement those rules (regardless of Unicode standards). </p><p></p><p>Actually, I think the problem is not with ToTitleCase() but ToLower(). ToTitleCase() takes a lower case string and uppercases the first letter of each word. If you pass an upper case string it returns it unchanged. In WebEPG, when a title with upper case only letters is found it is first turned to lower case via ToLower() and then the result is fed to ToTitleCase(). It is ToLower that fails to properly lower case Greek Sigmas.</p><p>E.g. (hope you can see Greek characters)</p><p>"ΙΣΩΣ" should become "ισως" but ToLower() returns "ισωσ"</p><p>("Σ" becomes "σ" in the middle of a word but "ς" at the end)</p><p></p><p>Along the above notes I have also tried the following code (that didn't work either):</p><p>[CODE]</p><p>CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;</p><p>TextInfo textInfo = cultureInfo.TextInfo;</p><p></p><p>string titlecase = textInfo.ToTitleCase(textInfo.ToLower(uppercase));[/CODE]</p><p></p><p>I also tried specific Culture (both "el" and 1032) and InvariantCulture (shouldn't work anyway)</p><p></p><p>The only way I could make it work is using RegEx:</p><p></p><p>[CODE]</p><p>CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;</p><p>TextInfo textInfo = cultureInfo.TextInfo;</p><p>Regex re = new Regex("\\u03c3(?=($|\\W))");</p><p></p><p>string titlecase = textInfo.ToTitleCase(re.Replace(textInfo.ToLower(uppercase), "\u03c2"));[/CODE]</p><p></p><p>Thanks,</p><p>Panayotis</p></blockquote><p></p>
[QUOTE="arion_p, post: 161670, member: 45945"] Hi james, I tried your code this morning but it didn't work. I also remember reading some article about Greek Final Sigma special casing rules in Unicode. According to the article the special casing rules where initialy included in the Unicode draft but later on they where dropped to avoid complexity. However the current version of Unicode includes those rules. Anyway it seems the NET team decided not to implement those rules (regardless of Unicode standards). Actually, I think the problem is not with ToTitleCase() but ToLower(). ToTitleCase() takes a lower case string and uppercases the first letter of each word. If you pass an upper case string it returns it unchanged. In WebEPG, when a title with upper case only letters is found it is first turned to lower case via ToLower() and then the result is fed to ToTitleCase(). It is ToLower that fails to properly lower case Greek Sigmas. E.g. (hope you can see Greek characters) "ΙΣΩΣ" should become "ισως" but ToLower() returns "ισωσ" ("Σ" becomes "σ" in the middle of a word but "ς" at the end) Along the above notes I have also tried the following code (that didn't work either): [CODE] CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; string titlecase = textInfo.ToTitleCase(textInfo.ToLower(uppercase));[/CODE] I also tried specific Culture (both "el" and 1032) and InvariantCulture (shouldn't work anyway) The only way I could make it work is using RegEx: [CODE] CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; Regex re = new Regex("\\u03c3(?=($|\\W))"); string titlecase = textInfo.ToTitleCase(re.Replace(textInfo.ToLower(uppercase), "\u03c2"));[/CODE] Thanks, Panayotis [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
WebEPG and proper Title-casing in Greek
Contact us
RSS
Top
Bottom