Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #164671
| Path | csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | om@iki.fi (Otto J. Makela) |
| Newsgroups | comp.lang.c |
| Subject | Re: UTF-8 strings in C |
| Date | Thu, 27 Jan 2022 13:32:43 +0200 |
| Organization | Games and Theory |
| Lines | 25 |
| Message-ID | <87lez1pg6c.fsf@tigger.extechop.net> (permalink) |
| References | <strlen-20220108201256@ram.dialup.fu-berlin.de> <srgj1m$p9s$1@dont-email.me> <srgqvn$5gn$1@gioia.aioe.org> <srh1kj$epo$1@dont-email.me> <srh3b9$q0m$1@dont-email.me> <srhcti$tvd$1@dont-email.me> <87lezih5b5.fsf@tigger.extechop.net> <87h7a6h0lp.fsf@tigger.extechop.net> <srtvd7$143n0$2@solani.org> <87k0es9kag.fsf@tigger.extechop.net> <sshlmu$vqi$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | reader02.eternal-september.org; posting-host="2210ec353eac979e98d0323d717205c9"; logging-data="16054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19X4/ng4ddi9G4GVeZVaBB/" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
| Cancel-Lock | sha1:8zq0SU2qXL/V6kdLuz4Rqg8NzPE= sha1:MFB1369dZGq25bAV/D/Sbj88blw= |
| X-Face | 'g'S,X"!c;\pfvl4ljdcm?cDdk<-Z;`x5;YJPI-cs~D%;_<\V3!3GCims?a*;~u$<FYl@"E c?3?_J+Zwn~{$8<iEy}EqIn_08"`oWuqO$#(5y3hGq8}BG#sag{BL)u8(c^Lu;*{8+'Z-k\?k09ILS |
| X-URL | http://www.iki.fi/om/ |
| Mail-Copies-To | never |
| Xref | csiph.com comp.lang.c:164671 |
Show key headers only | View raw
James Kuyper <jameskuyper@alumni.caltech.edu> wrote: > The set of valid extended characters is locale-dependent (5.2.1p1). In > the "C" locale on my system, there are none - only the basic character > set is supported. It's not clear to me that the C standard requires > this, but it certainly allows it. > > You need to use setlocale() to select a locale that supports UTF-8. > Which locales are supported depend upon your implementation. On my > platform, the default locale (the one chosen if the second argument of > setlocale() is "") is determined by the LC_LANG environment, which I > have set to "en_US.UTF-8". When I insert setlocale(LC_CTYPE, "") in > your program before the mblen() call, I get the following results: > > 'Ä' c3 84 00 2 Yep, that setlocale() call did it. I actually have the semi-joke value of LANG=en_DK.UTF-8 in my environment, produces good results for me. https://unix.stackexchange.com/questions/62316/why-is-there-no-euro-english-locale -- /* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */ /* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */ /* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */ /* * * Computers Rule 01001111 01001011 * * * * * * */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-10 07:17 +0100
Re: UTF-8 strings in C Mateusz Viste <mateusz@xyz.invalid> - 2022-01-10 09:32 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-10 11:26 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-10 11:55 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-10 14:38 +0100
Re: UTF-8 strings in C om@iki.fi (Otto J. Makela) - 2022-01-14 14:26 +0200
Re: UTF-8 strings in C om@iki.fi (Otto J. Makela) - 2022-01-14 16:07 +0200
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 15:42 +0100
Re: UTF-8 strings in C Philipp Klaus Krause <pkk@spth.de> - 2022-01-15 09:08 +0100
Re: UTF-8 strings in C om@iki.fi (Otto J. Makela) - 2022-01-22 11:44 +0200
Re: UTF-8 strings in C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-01-22 04:48 -0800
Re: UTF-8 strings in C Richard Damon <Richard@Damon-Family.org> - 2022-01-22 08:27 -0500
Re: UTF-8 strings in C James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-22 14:25 -0500
Re: UTF-8 strings in C om@iki.fi (Otto J. Makela) - 2022-01-27 13:32 +0200
Re: UTF-8 strings in C om@iki.fi (Otto J. Makela) - 2022-01-27 13:33 +0200
Re: UTF-8 strings in C James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-27 11:08 -0500
Re: UTF-8 strings in C Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-02-03 22:23 -0800
Re: UTF-8 strings in C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-01-14 04:41 -0800
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 14:43 +0100
Re: UTF-8 strings in C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-01-14 05:45 -0800
Re: UTF-8 strings in C Mateusz Viste <mateusz@xyz.invalid> - 2022-01-14 15:10 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 15:43 +0100
Re: UTF-8 strings in C Bart <bc@freeuk.com> - 2022-01-14 15:50 +0000
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 17:50 +0100
Re: UTF-8 strings in C Mateusz Viste <mateusz@xyz.invalid> - 2022-01-14 17:17 +0100
Re: UTF-8 strings in C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-01-14 08:34 -0800
Re: UTF-8 strings in C Mateusz Viste <mateusz@xyz.invalid> - 2022-01-14 17:42 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 17:51 +0100
Re: UTF-8 strings in C Mateusz Viste <mateusz@xyz.invalid> - 2022-01-14 18:07 +0100
Re: UTF-8 strings in C Bonita Montero <Bonita.Montero@gmail.com> - 2022-01-14 18:19 +0100
Re: UTF-8 strings in C Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-02-07 09:02 -0800
csiph-web