unicode in labels causes http 400 error
drdozer opened this issue · 2 comments
I have made a block diagram. Some of my labels include unicode characters. This causes a 400 error when rendering. If I comment out the lines with the unicode labels, the diagram renders. If I paste the same diagram text into the live editing box at https://kroki.io/#support it renders. So I think it must be something to do with how kroki.jl encodes unicode into the wire protocol.
This is a pluto cell that illustrates the issue. You can see some lines of the diagram are commented out. If you uncomment them, rendering fails.
blockdiag"""
blockdiag {
node_0 [label = "Axiom"];
node_1 [label = "Junction"];
node_0 -> node_1
//node_2 [label = "∧"];
node_1 -> node_2
//node_3 [label = "∨"];
node_1 -> node_3
node_4 [label = "Relation"];
node_0 -> node_4
node_5 [label = "Equivalency"];
node_4 -> node_5
//node_6 [label = "≃"];
node_5 -> node_6
//node_7 [label = "≄"];
node_5 -> node_7
node_8 [label = "IntervalPointRelation"];
node_4 -> node_8
node_9 [label = "containing"];
node_8 -> node_9
node_10 [label = "left"];
node_8 -> node_10
node_11 [label = "right"];
node_8 -> node_11
node_12 [label = "IntervalTopology"];
node_4 -> node_12
node_13 [label = "after"];
node_12 -> node_13
node_14 [label = "before"];
node_12 -> node_14
node_15 [label = "contained_by"];
node_12 -> node_15
node_16 [label = "contains"];
node_12 -> node_16
node_17 [label = "does_not_overlap"];
node_12 -> node_17
node_18 [label = "end_of"];
node_12 -> node_18
node_19 [label = "ends_with"];
node_12 -> node_19
node_20 [label = "gap_then"];
node_12 -> node_20
node_21 [label = "overlaps_with"];
node_12 -> node_21
node_22 [label = "same_location"];
node_12 -> node_22
node_23 [label = "start_of"];
node_12 -> node_23
node_24 [label = "starts_with"];
node_12 -> node_24
node_25 [label = "then"];
node_12 -> node_25
node_26 [label = "within"];
node_12 -> node_26
node_27 [label = "PointNeighbours"];
node_4 -> node_27
node_28 [label = "does_not_touch"];
node_27 -> node_28
node_29 [label = "touches"];
node_27 -> node_29
node_30 [label = "PointOrdering"];
node_4 -> node_30
node_31 [label = "<"];
node_30 -> node_31
node_32 [label = ">"];
node_30 -> node_32
//node_33 [label = "≤"];
node_30 -> node_33
//node_34 [label = "≥"];
node_30 -> node_34
node_35 [label = "RelativeStrand"];
node_4 -> node_35
node_36 [label = "different_strand"];
node_35 -> node_36
node_37 [label = "same_strand"];
node_35 -> node_37
node_38 [label = "StrandedPointRelation"];
node_4 -> node_38
node_39 [label = "five_prime"];
node_38 -> node_39
node_40 [label = "three_prime"];
node_38 -> node_40
node_41 [label = "StrandedTopology"];
node_4 -> node_41
node_42 [label = "abuts_33"];
node_41 -> node_42
node_43 [label = "abuts_35"];
node_41 -> node_43
node_44 [label = "abuts_53"];
node_41 -> node_44
node_45 [label = "abuts_55"];
node_41 -> node_45
node_46 [label = "downstream_of"];
node_41 -> node_46
node_47 [label = "overlaps_33"];
node_41 -> node_47
node_48 [label = "overlaps_35"];
node_41 -> node_48
node_49 [label = "overlaps_53"];
node_41 -> node_49
node_50 [label = "overlaps_55"];
node_41 -> node_50
node_51 [label = "started_by_33"];
node_41 -> node_51
node_52 [label = "started_by_35"];
node_41 -> node_52
node_53 [label = "started_by_53"];
node_41 -> node_53
node_54 [label = "started_by_55"];
node_41 -> node_54
node_55 [label = "upstream_of"];
node_41 -> node_55
node_56 [label = "interval_length"];
node_4 -> node_56
node_57 [label = "strand"];
node_4 -> node_57
node_58 [label = "StrandedOrdering"];
node_0 -> node_58
//node_59 [label = "<ˢ"];
node_58 -> node_59
//node_60 [label = ">ˢ"];
node_58 -> node_60
//node_61 [label = "≤ˢ"];
node_58 -> node_61
//node_62 [label = "≥ˢ"];
node_58 -> node_62
node_63 [label = "TruthValue"];
node_0 -> node_63
//node_64 [label = "_⊤"];
node_63 -> node_64
//node_65 [label = "⊥"];
node_63 -> node_65
node_66 [label = "gapsize"];
node_0 -> node_66
}
""" |> as_png
Ouch - I think the issue is in the as_png
call - sorry for the false bug report!
No worries! Glad you got it sorted. Also sorry for the late reply, GitHub's notifications to my e-mail are a complete mess :(