Differences From Artifact [13b78669de]:
- File src/OFSystemInfo.m — part of check-in [f12cecf014] at 2017-01-08 02:38:36 on branch trunk — Get native8BitEncoding from locale (user: js, size: 10069) [annotate] [blame] [check-ins using]
To Artifact [2f5eb2340c]:
- File
src/OFSystemInfo.m
— part of check-in
[d6de0a1b71]
at
2017-01-08 03:45:05
on branch trunk
— Parse locale to get {language,territory,encoding}
Yes, there is really nothing to query this.
Yes, locales in C and POSIX are broken way beyond repair. (user: js, size: 11642) [annotate] [blame] [check-ins using]
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | /* Work around __block being used by glibc */ #include <stdlib.h> /* include any libc header to get the libc defines */ #ifdef __GLIBC__ # undef __USE_XOPEN #endif #include <locale.h> #include <unistd.h> #include "platform.h" #ifdef OF_MAC_OS_X # include <sys/sysctl.h> #endif |
︙ | |||
61 62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | struct x86_regs { uint32_t eax, ebx, ecx, edx; }; #endif static size_t pageSize; static size_t numberOfCPUs; static of_string_encoding_t native8BitEncoding = OF_STRING_ENCODING_UTF_8; static OFString *language = nil; static OFString *territory = nil; static OFString *decimalPoint = @"."; void of_system_info_parse_locale(char *locale) { if (locale == NULL) return; |
︙ | |||
145 146 147 148 149 150 151 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | + + - + + + + + + + + + - + | + (size_t)numberOfCPUs { return numberOfCPUs; } + (of_string_encoding_t)native8BitEncoding { return native8BitEncoding; } |
︙ |