FreeBSD Bugzilla – Attachment 239952 Details for
Bug 269375
querylocale of LC_COLLATE fails after changing from C.UTF-8 to C
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
A short C reproducer program
bug.c (text/plain), 952 bytes, created by
Karl Williamson
on 2023-02-06 16:38:32 UTC
(
hide
)
Description:
A short C reproducer program
Filename:
MIME Type:
Creator:
Karl Williamson
Created:
2023-02-06 16:38:32 UTC
Size:
952 bytes
patch
obsolete
>#include <stdio.h> >#include <locale.h> >#include <string.h> >#include <errno.h> > >int >main(int argc, char **argv) >{ > > //fprintf(stderr, "%s\n", setlocale(0, "C.UTF-8/C/C/C/C/C")); > locale_t C = newlocale(LC_ALL_MASK, "C", 0); > if (! uselocale(C)) { > fprintf(stderr, "uselocale of C failed; errno=%d\n", errno); > } > > fprintf(stdout, "LC_COLLATE using C locale=%s\n", querylocale(LC_COLLATE_MASK, C)); > > locale_t C8 = newlocale(LC_ALL_MASK, "C.UTF-8", 0); > if (! uselocale(C8)) { > fprintf(stderr, "uselocale of C.UTF-8 failed; errno=%d\n", errno); > } > > fprintf(stdout, "LC_COLLATE using C.UTF-8 locale=%s\n", querylocale(LC_COLLATE_MASK, C8)); > > if (! uselocale(C)) { > fprintf(stderr, "uselocale of C failed; errno=%d\n", errno); > } > > /* This should read C as we have changed back to the C object */ > fprintf(stdout, "LC_COLLATE using C locale again=%s\n", querylocale(LC_COLLATE_MASK, C)); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 269375
: 239952