Closed JerwuQu closed 2 years ago
Sorry it closed the bug automatically,
it seems to work if we have an extern to use the original wcwidth
in C.
Can you try if it works for you?
I'm not sure what you mean (though I am quite new to Haxe). Are you talking about some sort of conditional compilation to use the original function rather than this library for when targeting C++?
Ah my bad, I just noticed you had made commits targeting this issue!
Slight issue now is that the API differs and the wclength
method no longer exists: Class<wcwidth.Wcwidth> has no field wclength
.
I think this might be the right track though (in the case that both your implementation and the POSIX one behave the same.)
Yes it's true. Since this is such a small lib I just removed the namespace altogether. It is a lib that is not supposed to evolve once it works, so people can easily put it in a package if they want.
Example:
using Wclength;
"ありがとうございました".wclength(); // gives 22
The internal wcwidth()
is still available of course, you can see in the README.
About them behaving the same, it's supposed to.
Otherwise it's a bug or the original has been updated (but I think it hasn't been in years).
It's not difficult to have something like a -D wcwidth_force_haxe_implementation
, we can have it later if you need.
Sounds great! Thank you
Hello again!
When compiling this package for C++, it will throw an error due to the resulting namespace conflicting with the POSIX wcwidth.
I'm not sure if there's any solution for this right now besides renaming the package (which works, but might not be desirable...?)
Do you have any ideas?