thanks, I'm using Ruby.
In particularly I'm using
ruby 2.6.0dev (2018-06-22 trunk 63723) [x86_64-darwin17]
I see that the length of the input string is 4 for "bär" but if I type
"bär".length
The result is 3
Forgot to mention, if I run the script via command line, like
./mzScript.rb bär
the result is exactly what I expect.