Skip to content

Commit 99d57a2

Browse files
committed
Merge pull request #46 from ocsigen/utf8_bis
using re-encoding function from Tyxml
2 parents 5a718b9 + 34fbf4a commit 99d57a2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.jenkins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
opam pin add --no-action tyxml 'https://github.com/ocsigen/tyxml.git#master'
22
opam pin add --no-action ocsigenserver .
33
opam install camlzip
44
opam install --deps-only ocsigenserver

opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ depends: [
2323
"ocamlnet" {>= "3.6.0"}
2424
"pcre-ocaml"
2525
"cryptokit"
26-
"tyxml" {>= "3.1.0"}
26+
"tyxml" {>= "dev"}
2727
("dbm" | "sqlite3-ocaml")
2828
"ipaddr" {>= "2.1"}
2929
]

src/http/ocsigen_senders.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ open Ocsigen_stream
2828

2929

3030
(*****************************************************************************)
31-
(** this module instantiate the HTTP_CONTENT signature for an Xhtml content*)
31+
(** this module instantiate the HTTP_CONTENT signature for an Html content*)
3232

3333
module Make_XML_Content(Xml : Xml_sigs.Iterable)
3434
(Typed_xml : Xml_sigs.Typed_xml with module Xml := Xml)
3535
= struct
3636

37-
module Xhtmlprinter =
37+
module Htmlprinter =
3838
Xml_print.Make_typed(Xml)(Typed_xml)(Ocsigen_stream.StringStream)
3939

4040
type t = Typed_xml.doc
@@ -64,13 +64,15 @@ module Make_XML_Content(Xml : Xml_sigs.Iterable)
6464
choose_content_type options
6565
Typed_xml.Info.alternative_content_types
6666
Typed_xml.Info.content_type in
67-
let x = Xhtmlprinter.print ~advert c in
67+
let encode x = fst (Xml_print.Utf8.normalize_html x) in
68+
let x = Htmlprinter.print ~encode ~advert c in
6869
let default_result = Result.default () in
6970
Lwt.return
7071
(Result.update default_result
7172
~content_length:None
7273
~content_type:(Some content_type)
7374
~etag:(get_etag c)
75+
~charset:(Some "utf-8")
7476
~headers:Http_headers.dyn_headers
7577
~stream:(x, None) ())
7678
end

0 commit comments

Comments
 (0)