Fórum

Asset publisher friendly url based on UTF-8 encoding

thumbnail
parviz makari, modificado 9 Anos atrás.

Asset publisher friendly url based on UTF-8 encoding

New Member Postagens: 6 Data de Entrada: 03/01/14 Postagens Recentes
Hi there,

We're developing a website for a company using Liferay-6.2-CE Portal...We made up our mind to use asset publisher for some reasons.

We have a big problem with generated URL by asset publisher while adding web content....for example, I added a basic web content and set web content Title to "Foo" and also I set web content display page to a page where asset publisher has placed and when I attempt to open web content from asset publisher..(click on "view" link)..it displays content of web content..and the generated URL is "http://LocalHost:8080/en/web/guest/-/Foo" everything's good...But, When I try to add "سلام" as a Title of web content the generated URL is ""http://LocalHost:8080/en/web/guest/-/--1".

I also changed database(oracle) collation to UTF-8 but nothing happenedemoticon and Persian title dose not correctly save in database....Anyone knows how to fix it.....!!!!
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Asset publisher friendly url based on UTF-8 encoding

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Parviz,

I have never done a site in a non latin based character set so I'm not entirely sure if Liferay supports it (as far as the Friendly URLs go). One thing that I noticed from your message is that your URL is a bit odd --

... content the generated URL is http://LocalHost:8080/en/web/guest/-/--1


You have "en" in the url for the language. If you are looking to produce arabic characters, I would have expected a different language value no?

Also, you might want to dig into some of the FriendyURL* classes from the portal. I had a quick look but as this is not an area that I typically find myself, I'm not entirely sure what to be looking for. Try having a look at

com.liferay.portal.util.FriendlyURLNormalizer#normalize(String Pattern)
com.liferay.util.Normalizer#normalizeToAscii(String)

.. one of those might help you understand what is happening under the hood. As for why they are not being saved to your oracle DB. If the table was created before the charset was set then perhaps the "change" isn;t taking effect. I once has a similar case with MySQL and I had to actually set teh UTF-8 for each column (when trying to change the character encoding after it was already created).
thumbnail
Parviz Makari, modificado 8 Anos atrás.

RE: Asset publisher friendly url based on UTF-8 encoding

New Member Postagens: 6 Data de Entrada: 03/01/14 Postagens Recentes
Thanks for your response, I tried both of them("en" & "fa") but nothing solved..url titles don't store in DB as a UTF-8...
I'm gonna be looking through the classes that you mentioned.emoticon