Re: how to write a string to a c pointer?

2015-03-06 Thread FG via Digitalmars-d-learn
On 2015-03-06 at 00:25, ketmar wrote: unicode sux[1]. [1] http://file.bestmx.net/ee/articles/uni_vs_code.pdf Great article. Thanks, Кетмар ⚠ ∑ ♫ ⚽ ☀ ☕ ☺ ≡ ♛

Re: how to write a string to a c pointer?

2015-03-06 Thread Kagamin via Digitalmars-d-learn
On Friday, 6 March 2015 at 00:53:49 UTC, Ali Çehreli wrote: It made me happy that I was not the only person who has been ruminating over alphabet as the crucial piece in this whole Unicode story. I've been giving the example of if I have a company name as the string ali jim, the uppercase of

Re: how to write a string to a c pointer?

2015-03-05 Thread ketmar via Digitalmars-d-learn
On Thu, 05 Mar 2015 16:36:35 +0100, FG wrote: Damn those composite characters! or invisible ones. or RTL switch. unicode sux[1]. [1] http://file.bestmx.net/ee/articles/uni_vs_code.pdf signature.asc Description: PGP signature

Re: how to write a string to a c pointer?

2015-03-05 Thread Ali Çehreli via Digitalmars-d-learn
On 03/05/2015 03:25 PM, ketmar wrote: unicode sux[1]. [1] http://file.bestmx.net/ee/articles/uni_vs_code.pdf Thanks. I enjoyed the article and I agree with everything said in there. It made me happy that I was not the only person who has been ruminating over alphabet as the crucial piece

Re: how to write a string to a c pointer?

2015-03-05 Thread FG via Digitalmars-d-learn
On 2015-03-05 at 10:42, Kagamin wrote: string s; char[] b = cast(char[])asArray(); b[0..s.length] = s[]; It's a bit more complicated than that if you include cutting string for buffers with smaller capacity, doing so respecting UTF-8, and adding a '\0' sentinel, since you may want to use the

Re: how to write a string to a c pointer?

2015-03-05 Thread Kagamin via Digitalmars-d-learn
string s; char[] b = cast(char[])asArray(); b[0..s.length] = s[];

Re: how to write a string to a c pointer?

2015-03-05 Thread zhmt via Digitalmars-d-learn
On Thursday, 5 March 2015 at 09:42:53 UTC, Kagamin wrote: string s; char[] b = cast(char[])asArray(); b[0..s.length] = s[]; Thank you very much. I should stop my developing , and read the dlang tutorial again.