projects/aports·blob master · refs

17 lines · 531 B

1--- a/char_conv.c
2+++ b/char_conv.c
3@@ -132,7 +132,13 @@ EXPORT_DEF ssize_t gsm7_encode(const uint16_t *in, size_t in_length, uint16_t *o
4 {
5 // TODO: Should we check for other tables or just use UCS-2?
6 unsigned bytes = 0;
7- const uint8_t *escenc = get_char_gsm7_encoding(0x1B00);
8+ const uint8_t *escenc = get_char_gsm7_encoding(
9+#if __BYTE_ORDER == __BIG_ENDIAN
10+ 0x001B
11+#else
12+ 0x1B00
13+#endif
14+ );
15 for (unsigned i = 0; i < in_length; ++i) {
16 const uint8_t *enc = get_char_gsm7_encoding(in[i]);
17 uint8_t c = enc[0];