Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-04 Thread crimaniak via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 14:39:34 UTC, ag0aep6g wrote: Looks like forum.dlang.org has a problem when they appear side by-side. Works (in the preview): ‍‍‍ ️‍ Doesn't work: ‍‍‍️‍ For me, it looks as the used font has ligatures for these faces. Mozilla under Linux, I guess it's

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-04 Thread ag0aep6g via Digitalmars-d-learn
On 07/04/2018 05:12 PM, aliak wrote: Is updating unicode stuff to the latest a matter of some config file somewhere with the code point configurations that result in specific graphemes? I don't know. [...] Also, any reason (technical or otherwise) that we have to slice a grapheme to get it

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-04 Thread aliak via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 14:37:32 UTC, Adam D. Ruppe wrote: On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: [...] What system are you on? Successfully printing this stuff depends on a lot of display details too, like writeln goes to a terminal/console and they are rarely configured

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-04 Thread aliak via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 14:43:37 UTC, Steven Schveighoffer wrote: On 7/3/18 10:37 AM, ag0aep6g wrote: On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: foreach (c; "‍‍‍️‍") {   writeln(c); } So basically the above just doesn't work. Prints gibberish. Because you're printing one

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/3/18 10:37 AM, ag0aep6g wrote: On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: foreach (c; "‍‍‍️‍") {   writeln(c); } So basically the above just doesn't work. Prints gibberish. Because you're printing one UTF-8 code unit (`char`) per line. So I figured, std.uni.byGrapheme

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: So basically the above just doesn't work. Prints gibberish. What system are you on? Successfully printing this stuff depends on a lot of display details too, like writeln goes to a terminal/console and they are rarely configured to

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread ag0aep6g via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 13:36:56 UTC, aliak wrote: Hehe I guess the forum really is using D :p The two graphemes I'm talking about (which seem to not be rendered correctly above) are: family emoji: https://emojipedia.org/family-woman-woman-boy-boy/ rainbow flag:

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread ag0aep6g via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: foreach (c; "‍‍‍️‍") { writeln(c); } So basically the above just doesn't work. Prints gibberish. Because you're printing one UTF-8 code unit (`char`) per line. So I figured, std.uni.byGrapheme would help, since that's what they

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/3/18 9:32 AM, aliak wrote: Hi, trying to figure out how to loop through a string of characters and then spit them back out. Eg: foreach (c; "‍‍‍️‍") {   writeln(c); } So basically the above just doesn't work. Prints gibberish. So I figured, std.uni.byGrapheme would help, since

Re: what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread aliak via Digitalmars-d-learn
On Tuesday, 3 July 2018 at 13:32:52 UTC, aliak wrote: Hi, trying to figure out how to loop through a string of characters and then spit them back out. Eg: foreach (c; "‍‍‍️‍") { writeln(c); } So basically the above just doesn't work. Prints gibberish. So I figured,

what's the correct way to handle unicode? - trying to print out graphemes here.

2018-07-03 Thread aliak via Digitalmars-d-learn
Hi, trying to figure out how to loop through a string of characters and then spit them back out. Eg: foreach (c; "‍‍‍️‍") { writeln(c); } So basically the above just doesn't work. Prints gibberish. So I figured, std.uni.byGrapheme would help, since that's what they are, but I can't