Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-2007, 10:06 AM
Project Contributor
 
Posts: 87
Default Date Zimlet Translation

Hi,
im translating the Zimlet to recognize Spanish dates formats, the zimlet is almost finished, but im having problems with this REGEX:

var $RE_NEXT_THIS_LAST = "(pr\u00f3ximo|este|\u00faltimo)";

as you see, \u00faltimo = último, but the regex engine is not matching this word, truly the regex engine its not matching any word that starts with an UTF-8 cacharacter.

any ideas?
__________________
Patricio Bruna
http://www.it-linux.cl/pbruna
Reply With Quote
  #2 (permalink)  
Old 01-29-2008, 09:35 AM
Partner (VAR/HSP)
 
Posts: 200
Default

Quote:
Originally Posted by pbruna View Post
Hi,
im translating the Zimlet to recognize Spanish dates formats, the zimlet is almost finished, but im having problems with this REGEX:

var $RE_NEXT_THIS_LAST = "(pr\u00f3ximo|este|\u00faltimo)";

as you see, \u00faltimo = último, but the regex engine is not matching this word, truly the regex engine its not matching any word that starts with an UTF-8 cacharacter.

any ideas?
Hi,

I can confirm that. It seem impossible to match a word starting with a UTF-8 character. Did you find a solution or a workaround for that?

Thanks and Regards
Thomas
Reply With Quote
  #3 (permalink)  
Old 01-29-2008, 10:10 AM
Project Contributor
 
Posts: 87
Default neither

I could not resolve this issue.
__________________
Patricio Bruna
http://www.it-linux.cl/pbruna
Reply With Quote
  #4 (permalink)  
Old 01-29-2008, 10:27 AM
Partner (VAR/HSP)
 
Posts: 200
Default

Quote:
Originally Posted by pbruna View Post
I could not resolve this issue.
But in the meanwhile I could :-)

The problem is not the UTF-8 char in the beginning of the word, but the word boundary "\b" metacharacter.

The "\b" apperently matches the first byte of the UTF-8 character preventing the remaining regexp to match against the word.

You can verify this when you remove the first "\\b" in your ZmDateES2ObjectHandler.REGEX:

ZmDateES2ObjectHandler.REGEX = new RegExp( $RE_NEXT_THIS_LAST + $RE_SP + $RE_DOW + "\\b", "ig");

This works for me. But maybe there is a better solution to this...

Regards
Thomas
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.