-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for spanish é, ç and other letters. #31
Comments
I just added the error description 😅 |
I found the solution to the problem: Julia uses "byte" indexing for characters, instead of "character" indexing. Futher explanations:Example: The text "OteraEngine" has the following index: [1] => O
[2] => t
[3] => e
[4] => r
[5] => a
[6] => E
[7] => n
[8] => g
[9] => i
[10] => n
[11] => e Character However, Spanish (french and many others) have alphabet letters that are 2 byte long. Which includes: ñ, é, ç, and others. Example 2: The text "España" (which means spain) has the index: [1] => E
[2] => s
[3] => p
[4] => a
[5] => n
[6] => ~
[7] => a So, when I try to retrieve the index by using the SolutionReplace |
Hi @codigomaye I think the bug is the same to this one, and fixed in v0.5.1. |
Hey @MommaWatasu, Thanks for your reply. The error I get is from both v0.5.1 and v0.5.0 (I tried both out of curiosity) Reproducible steps:
txt = "élena"
tmp = Template(txt, path = false) This leads to an error julia> txt = "élena"
julia> i = 1
julia> while i <= length(txt)
println(txt[i])
i = i + 1
end This example reproduce the while loop used it Now, if we change a while loop and julia> txt = "élena"
julia> i = 1
julia> for i in eachindex(txt)
println(txt[i])
end We get the desired result, without affecting the logic of the codes 👍 . |
I rectified the while example above 👍 |
I checked this issue right now. More or less the same problem as in v.0.5.0. v0.5.1 solves it for characters like à, but not for others like ñ and é. Because of how The solution in v.0.5.1 is still incomplete, as I couldn't render a Spanish web page until I did a |
Thanks for your great effort! |
Hey @MommaWatasu , I will check it right away 👍 |
Hey @MommaWatasu , now it works perfectly 👍 . This is a screen capture of the rendered page, to make you feel happy for the great job you did 😄 Have a nice day 😄 |
Thanks for the screenshot, I'm glad to see how OteraEngine is used! |
Hey dear MommaWatasu,
I hope you can help me on this one please 😅.
The problem
When I try to insert Spanish text in a
p
HTML tag, I get some error.Ex:
The error:
Futher explanations:
Julia uses "byte" indexing for characters, instead of "character" indexing.
Example: The text "OteraEngine" has the following index:
Character
t
is the length of characterO
+ 1. Because each of these character represent 1 byte. (So we can consider that each English alphabet letter is 1 byte long).However, Spanish (french and many others) have alphabet letters that are 2 byte long. Which includes: ñ, é, ç, and others.
Example 2: The text "España" (which means spain) has the index:
So, when I try to retrieve the index by using the
lenght()
function, I get into an error because text[5] and text[6] can't be separated. (This is how I understand it, I think there is a better way to explain it though)Solution
Replace
while i <= length(txt)
tofor i in eachindex(txt)
. This ensures that you get the character index each time. Which enables OteraEngine to parse characters of their languages. (I tried it and it worked!).The text was updated successfully, but these errors were encountered: