On Monday, 18 May 2020 at 14:28:33 UTC, Steven Schveighoffer
wrote:
What you need is to normalize the data for comparison:
https://dlang.org/phobos/std_uni.html#normalize
For more reference:
https://en.wikipedia.org/wiki/Combining_character
-Steve
I checked it again but could not
On Monday, 18 May 2020 at 14:28:33 UTC, Steven Schveighoffer
wrote:
On 5/18/20 9:44 AM, Martin Tschierschke wrote:
[...]
using == on strings is going to compare the exact bits for
equality. In unicode, things can be encoded differently to make
the same grapheme. For example, ö is a code
On Monday, 18 May 2020 at 14:22:31 UTC, WebFreak001 wrote:
[...]
It solved the problem, but what is the right way to use
umlauts (encode them) inside the program?
Your code should have already worked like that, assuming your
input file is a UTF-8 file. Check with an editor like Notepad++
or
On 5/18/20 9:44 AM, Martin Tschierschke wrote:
Hi,
I have to find a certain line in a file, with a text containing umlauts.
How do you do this?
The following was not working:
foreach(i,line; file){
if(line=="My text with ö oe, ä ae or ü"){
writeln("found it at line",i)
}
}
I ended up
On Monday, 18 May 2020 at 13:44:15 UTC, Martin Tschierschke wrote:
Hi,
I have to find a certain line in a file, with a text containing
umlauts.
How do you do this?
The following was not working:
foreach(i,line; file){
if(line=="My text with ö oe, ä ae or ü"){
writeln("found it at
Hi,
I have to find a certain line in a file, with a text containing
umlauts.
How do you do this?
The following was not working:
foreach(i,line; file){
if(line=="My text with ö oe, ä ae or ü"){
writeln("found it at line",i)
}
}
I ended up using line.canFind("with part of the text