Closed decioferreira closed 1 month ago
miniBill/elm-unicode#3 might have the solution for this
The fact that getCharWidth 'ā¤'
returns 1 while getCharWidth 'š'
returns 4 leaves me stumped. Maybe we need a script that just compiles
module Hello exposing (main)
import Html exposing (text)
main =
text "<insert unicode char here>"
for various unicode chars until we have enough examples that a pattern emerges.
There must some issue somewhere else on the code, because if I try to parse this š
on https://github.com/elm/core/blob/1.0.5/src/Char.elm#L44 it gives me NaN
on getCharWidth
, but when trying it separately, it seems to work fine. Running the following on https://elm-lang.org/try:
import Html exposing (text)
main =
text (Debug.toString (Char.toCode 'š'))
Returns 128584
finally found the fix for this one, the issue related to elm/core#977. Parse.Primitives. unsafeIndex
and elm-tests have been updated as part of this change.
Currently the implementation of
Parse.Primitives.getCharWidth
is very poor. We need to fix it.One of the current issue shows up when trying to compile
examples/src/HttpQuotes.elm
: