Unicode characters in url

22 views
Skip to first unread message

jmnotin

unread,
Apr 19, 2012, 10:23:56 AM4/19/12
to gitit-...@googlegroups.com
Hello,

I experienced some problems with unicode characters in urls served by Gitit.
Running Gitit 0.8.1, I can have a link like this in a page:

un lien avec des [caractères accentués]().

and Gitit will create/display a page named "caractères accentués" correctly.

With a freshly compiled Gitit 0.9.0.1, I get an error:

Server error: Could not getWikiBase: (path, uri) = ("caract\65533res accentu\65533s","/caract\232res accentu\233s")

Did anymore face the same problem ? Is there a proper way to avoid it ? Like some plugin that normalizes links, and properly encodes space and unicode characters ?

Thanks for any help !


John MacFarlane

unread,
Apr 20, 2012, 12:16:58 PM4/20/12
to gitit-...@googlegroups.com
I think there's a serious problem here. I tried creating a page
with unicode characters in the name, and the filename is wrong
(improper encoding).

Here's what I think happened. I went to considerable pains a couple
of years ago to get unicode pathnames working properly in gitit,
working around some underlying libraries that were not unicode-aware.
My guess is that these underlying libraries have now been made
unicode-aware, so my workarounds now need to be removed.

Not sure yet if the changes are in happstack, or in ghc's base (file
name arguments to writeFile and the like), or both. I will look into
it further, but meanwhile users who need unicode page names might want
to revert to an earlier version of gitit.

+++ jmnotin [Apr 19 12 07:23 ]:


> Hello,
> I experienced some problems with unicode characters in urls served by
> Gitit.
> Running Gitit 0.8.1, I can have a link like this in a page:

> un lien avec des [caractres accentus]().
> and Gitit will create/display a page named "caractres accentus" correctly.


> With a freshly compiled Gitit 0.9.0.1, I get an error:
> Server error: Could not getWikiBase: (path, uri) = ("caract\65533res accentu\655
> 33s","/caract\232res accentu\233s")
>
> Did anymore face the same problem ? Is there a proper way to avoid it ?
> Like some plugin that normalizes links, and properly encodes space and
> unicode characters ?
> Thanks for any help !
>

> --
> You received this message because you are subscribed to the Google
> Groups "gitit-discuss" group.
> To view this discussion on the web visit
> [1]https://groups.google.com/d/msg/gitit-discuss/-/v5YTpjLd9i0J.
> To post to this group, send email to gitit-...@googlegroups.com.
> To unsubscribe from this group, send email to
> gitit-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/gitit-discuss?hl=en.
>
> References
>
> 1. https://groups.google.com/d/msg/gitit-discuss/-/v5YTpjLd9i0J

John MacFarlane

unread,
Apr 20, 2012, 1:06:34 PM4/20/12
to gitit-...@googlegroups.com
On further investigation, the problem is in filestore, at
least when compiled against ghc 7.4. I believe that the treatment
of file path arguments to system IO functions changed in ghc 7.4.

So, I'll need to change filestore, and probably use pragmas so it
will also work with earlier versions of GHC.

This also means that you may be able to fix your problem by
compiling gitit with an earlier version of GHC. Have you tried that?

+++ John MacFarlane [Apr 20 12 09:16 ]:

John MacFarlane

unread,
Apr 20, 2012, 8:02:16 PM4/20/12
to gitit-...@googlegroups.com
I have uploaded a new version of filestore (0.4.2).

You might try pulling the latest gitit source from the repository
and reinstalling with "cabal update && cabal install". (It depends on
this new filestore.)

I can't say that this works, though. It seems to work perfectly
on my linux box, but not on my Mac. I have not yet been able to figure
out why. You may find that it solves your problems, though.

John

+++ John MacFarlane [Apr 20 12 10:06 ]:

Jean-Marc Notin

unread,
Apr 23, 2012, 5:35:11 AM4/23/12
to gitit-...@googlegroups.com
Hi,

> I can't say that this works, though.  It seems to work perfectly
> on my linux box, but not on my Mac.  I have not yet been able to figure
> out why.  You may find that it solves your problems, though.
>

It works for me too !
Many thanks for answering and fixing so quickly ! :-)

--
Jean-Marc Notin

Reply all
Reply to author
Forward
0 new messages