cancel
Showing results for 
Search instead for 
Did you mean: 

Input text problem on alfresco 1.2RC1

anurak
Champ in-the-making
Champ in-the-making
Hi,

My problem is when I enter another language in text box(such as, create a new space) then it returned me an unreadable text. This problem just happened on this version(alfresco 1.2RC1).

My environment are alfresco1.2RC1, tomcat5.5, windows XP, eclipse.

Any suggestion,
anurak
10 REPLIES 10

kevinr
Star Contributor
Star Contributor
Have you created your database schema in UTF-8 format? By default most databases are ISO-8859-1 or similar single byte format. If you create your schema in UTF-8 you shouldn't have any problems. We test multiple languages including double-byte such as Chinese, Korean and Arabic with no problems.

Thanks,

Kevin

anurak
Champ in-the-making
Champ in-the-making
Hi,

Yes, I created the database with utf8 options. Like i said this problem  just found on version 1.2RC1, the version before this is ok.

Thanks,
anurak

kevinr
Star Contributor
Star Contributor
I've just tested this with RC2 and it seems fine - are you able to upgrade? All things going to plan, we will be releasing 1.2 final today…

Thanks,

Kevin

anurak
Champ in-the-making
Champ in-the-making
I just downloaded RC2 and testing it.

Another problem is the first time that i run RC1 and also RC2, i have to change my windows's regional  in part of standards and formats to English(normally i set it to Thai), if i didn't change it, alfresco will throw an exception when it try to import a content_template_examples.xml in bootstrap step. The problem its about date string in that file. I already debug this case and found that the problem came from DefaultTypeConverter.java when it try to convert that date string to Date object.
The below is part of codes from DefaultTypeConverter.java.

        INSTANCE.addConverter(String.class, Date.class, new TypeConverter.Converter<String, Date>()
        {
            public Date convert(String source)
            {
                Date date = ISO8601DateFormat.parse(source);
                if (date == null)
                {
                    throw new TypeConversionException("Failed to parse date " + source);
                }
                return date;
            }
        });

I fixed by modified parse() method of ISO8601DateFormat.java by get an instance of Calendar with US locale then it ok.

           // Calendar calendar = Calendar.getInstance(timezone);
            Calendar calendar = Calendar.getInstance(Locale.US);

I concern about this because the version before RC1 there is not the problem like this. What do you think, kavin?

Thanks,
anurak

davidc
Star Contributor
Star Contributor
anurak,

Within content_template_examples.xml there are mixed locale encodings of dates - some are in UTC, some are in UTC+1.  All other bootstrap .xml files contain UTC only.

So, the short-term workaround to bootstrap in another locale is to replace +1.00 with Z in content_template_examples.xml.

In the mean-time, we'll investigate why it's failing to parse both locale encodings during bootstrap.

davidc
Star Contributor
Star Contributor
anurak,

Can you tell us the exception that was thrown?

I don't yet understand how
Calendar calendar = Calendar.getInstance(Locale.US);
can fix the problem?

davidc
Star Contributor
Star Contributor
anurak,

After further investigation, it seems there's an issue handling non-Gregorian calendars.  Thanks for finding the problem.

We'll fix it, but it requires a different approach to the one you've provided.

davidc
Star Contributor
Star Contributor
ok, we have a fix now.  It won't be in v1.2 final, but will be available from SVN once commited.  Use http://www.alfresco.org/jira/browse/AR-453 to track when this occurs.

anurak
Champ in-the-making
Champ in-the-making
Thanks davidc.