Permalink
Browse files

use icu4e to canicalize article titles

  • Loading branch information...
1 parent 0d17ac3 commit 369124a23c74aaa9ba13e647ee435a3bf882670e Bryan Fink committed Nov 1, 2010
Showing with 18 additions and 3 deletions.
  1. +5 −0 Makefile
  2. +2 −1 apps/wriaki/ebin/wriaki.app
  3. +6 −1 apps/wriaki/src/wiki_resource.erl
  4. +3 −1 rebar.config
  5. +2 −0 rel/reltool.config
View
5 Makefile
@@ -1,3 +1,8 @@
+export ICU_CFLAGS=$(shell icu-config --cppflags-searchpath) \
+ $(shell icu-config --cflags)
+export ICU_LDFLAGS=$(shell icu-config --ldflags) \
+ $(shell icu-config --ldflags-icuio)
+
.PHONY: rel deps
all: deps
View
3 apps/wriaki/ebin/wriaki.app
@@ -47,7 +47,8 @@
stdlib,
webmachine,
erlydtl,
- wiki_creole
+ wiki_creole,
+ icu4e
]},
{mod, { wriaki_app, []}},
{env, []}
View
7 apps/wriaki/src/wiki_resource.erl
@@ -213,7 +213,12 @@ in_mode(RD, ModeName) ->
wrq:get_qs_value(ModeName, RD) /= undefined.
search_path(RD) ->
- base64url:encode(mochiweb_util:unquote(wrq:disp_path(RD))).
+ base64url:encode(
+ unicode:characters_to_binary(
+ ustring:tolower(
+ ustring:new(mochiweb_util:unquote(wrq:disp_path(RD)), utf8)),
+ ustring:encoding(),
+ utf8)).
finish_request(RD, Ctx) ->
case wrq:response_code(RD) of
View
4 rebar.config
@@ -9,5 +9,7 @@
{riakc, "1.0.1",
{git, "git://github.com/basho/riak-erlang-client", "711f94349ef9899da8e6"}},
{riakhttpc, "0.9.2",
- {git, "git://github.com/basho/riak-erlang-http-client", "9cf254d69cd123670996"}}]}.
+ {git, "git://github.com/basho/riak-erlang-http-client", "9cf254d69cd123670996"}},
+ {icu4e, "1.0.0",
+ {git, "git://github.com/beerriot/icu4e", "0bbe6d3ee29b4dacf685"}}]}.
View
2 rel/reltool.config
@@ -11,6 +11,7 @@
erlydtl,
wiki_creole,
ibrowse,
+ icu4e,
wriaki
]},
{rel, "start_clean", "",
@@ -24,6 +25,7 @@
"^erts.*/bin/(dialyzer|typer)"]},
{excl_archive_filters, [".*"]},
{app, wriaki, [{incl_cond, include}]},
+ {app, icu4e, [{incl_cond, include}]},
{app, wiki_creole, [{incl_cond, include}]},
{app, webmachine, [{incl_cond, include}]},
{app, erlydtl, [{incl_cond, include}]},

0 comments on commit 369124a

Please sign in to comment.