Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: Change fallback locale to C.UTF-8 #17085

Merged
merged 1 commit into from
Oct 10, 2019

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Oct 9, 2019

Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to C.UTF-8.

related: #14948 (comment)

Much of our code assumes UTF-8 support, and this is a more realistic
guess for modern systems anyway than the default character set (which
would be ASCII only). So change the assumed fallback locale (if no
locale is defined by the user or OS) to `C.UTF-8`.
@carnhofdaki
Copy link
Contributor

Tested ACK

@maflcko
Copy link
Member

maflcko commented Oct 9, 2019

Is there a way to test this or observe a difference?

@laanwj
Copy link
Member Author

laanwj commented Oct 9, 2019

I think this triggers if you unset all locale environment settings, or set them to invalid values.
Then try to create a unicode-named file (e.g. what the fsbridge tests do).

@carnhofdaki
Copy link
Contributor

carnhofdaki commented Oct 9, 2019

Is there a way to test this or observe a difference?

@MarcoFalke Sure. At least on ARM.

@carnhofdaki
Copy link
Contributor

@MarcoFalke Actually even on x86_64:

#!/bin/sh
export LC_ALL=aoeunthauut
test/test_bitcoin

... until the line in tests/fs_tests.cpp is changed according to #14948 (comment)

@laanwj
Copy link
Member Author

laanwj commented Oct 9, 2019

Yes, processor architecture shouldn't make a difference here. Though OS and C library differences might.

@maflcko
Copy link
Member

maflcko commented Oct 9, 2019

(before) $ LC_ALL=foobar ./src/test/test_bitcoin -t fs_tests 
Running 1 test case...
unknown location(0): fatal error: in "fs_tests/fsbridge_fstream": boost::system::system_error: boost::filesystem::path codecvt to string: error
test/fs_tests.cpp(13): last checkpoint: "fsbridge_fstream" test entry
*** 1 failure is detected in the test module "Bitcoin Core Test Suite"

(after)  $ LC_ALL=foobar ./src/test/test_bitcoin -t fs_tests
Running 1 test case...
*** No errors detected

ACK facb9a1

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK facb9a1315f97489a20eb0e969fdb14b5128ed2f
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUh+Vwv+PZx+VMlRL0aTqVNzWW4JIBSvwP9ocYvJikKafvOB2hqzJbOYq2bH/aks
LRXOBaPiawal/M7oSzZ5QNAtJSkYVrGb9Oxin+niBXLQILkmkX3EVTWWgVynrjmp
i1/2rprmnlcKAKrNW9/kcjXKhVAfBq5akQ1HuoAGCb4RDuI33kEbuiX9rOWFVkKO
+F8px5DfwKHotlkWdX9243eI1p8RllCNLUR2bct7YrGf5y9YLMsO7Y6NjBoFzC6h
TzTTFm2ME80OkHKvy7DksLMK8VFXqY9JiWrGbnP6CyP7K4iw2DMVGY/AUxFkWagU
NL5wboCZtCmdlcB8F8kFOoUaxElyPYWWXOxpa9IGL3+PZ7Yk6hr4MmFcI7N+0ktL
ZayzrqQKiiczMxqljhniWJeo1ha994F8VgxSgcEAgygRT7goQOOaERULs2k2OI6S
JvnOJvy1ymRGgMFLxH3D+nsZ7qLiNpwFmxV7vy86kRcDtsdQiRl3pKZ1C0mNVVNy
4w7beEqg
=0+w3
-----END PGP SIGNATURE-----

Timestamp of file with hash 90206a870662404d82581bfdbe4e04c973ddb2b8bef3edfde3660cce6e32cb35 -

laanwj added a commit that referenced this pull request Oct 10, 2019
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: #14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
@laanwj laanwj merged commit facb9a1 into bitcoin:master Oct 10, 2019
@maflcko maflcko added this to the 0.19.0 milestone Oct 12, 2019
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Oct 19, 2019
Much of our code assumes UTF-8 support, and this is a more realistic
guess for modern systems anyway than the default character set (which
would be ASCII only). So change the assumed fallback locale (if no
locale is defined by the user or OS) to `C.UTF-8`.

Github-Pull: bitcoin#17085
Rebased-From: facb9a1
@fanquake fanquake mentioned this pull request Oct 19, 2019
laanwj added a commit that referenced this pull request Oct 21, 2019
334e27e util: Filter out macOS process serial number (Hennadii Stepanov)
e1bacb5 rpc: fix -rpcclienttimeout 0 option (Fabian Jahr)
6a45766 doc: update bips.md with buried BIP9 deployments (MarcoFalke)
dc0fe7a util: Filter control characters out of log messages (Wladimir J. van der Laan)
ba46f39 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Backports the following PRs to the `0.19.0` [branch](https://github.com/bitcoin/bitcoin/tree/0.19):
  * #17184 -  util: Filter out macOS process serial number
  * #17131 - rpc: fix -rpcclienttimeout 0 option
  * #17111 - doc: update bips.md with buried BIP9 deployments
  * #17095 - util: Filter control characters out of log messages
  * #17085 - init: Change fallback locale to C.UTF-8

ACKs for top commit:
  laanwj:
    ACK  334e27e

Tree-SHA512: 436064c00f98bae8475d0e46ab104df6fc9bdae4927dcdd5cffa4242704256c749352e9cabb23cf806911b1c303ddcb0208a42d540412e98da2513176e5e1023
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Nov 17, 2019
Much of our code assumes UTF-8 support, and this is a more realistic
guess for modern systems anyway than the default character set (which
would be ASCII only). So change the assumed fallback locale (if no
locale is defined by the user or OS) to `C.UTF-8`.

Github-Pull: bitcoin#17085
Rebased-From: facb9a1
fxtc pushed a commit to fxtc/fxtc that referenced this pull request Nov 25, 2019
Much of our code assumes UTF-8 support, and this is a more realistic
guess for modern systems anyway than the default character set (which
would be ASCII only). So change the assumed fallback locale (if no
locale is defined by the user or OS) to `C.UTF-8`.

Github-Pull: bitcoin#17085
Rebased-From: facb9a1
fxtc pushed a commit to fxtc/fxtc that referenced this pull request Nov 25, 2019
Much of our code assumes UTF-8 support, and this is a more realistic
guess for modern systems anyway than the default character set (which
would be ASCII only). So change the assumed fallback locale (if no
locale is defined by the user or OS) to `C.UTF-8`.

Github-Pull: bitcoin#17085
Rebased-From: facb9a1
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 24, 2020
Summary:
facb9a1315f97489a20eb0e969fdb14b5128ed2f init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin/bitcoin#14948 (comment)

---

Backport of Core [[bitcoin/bitcoin#17085 | PR17085]]

Test Plan:
  ninja all check check-functional

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8747
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jul 5, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 12, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 13, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 13, 2021
facb9a1 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Much of our code assumes file system UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.

  related: bitcoin#14948 (comment)

ACKs for top commit:
  MarcoFalke:
    ACK facb9a1

Tree-SHA512: 5075f9fe6791572d76ec38c58cd56f04ed8086c06a7d7f446d062dffc313c62466ba81f1a7d6b8c7e95791fcff82e4f76871c3534478fbfe5beb456dd8eea340
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 9, 2021
334e27e util: Filter out macOS process serial number (Hennadii Stepanov)
e1bacb5 rpc: fix -rpcclienttimeout 0 option (Fabian Jahr)
6a45766 doc: update bips.md with buried BIP9 deployments (MarcoFalke)
dc0fe7a util: Filter control characters out of log messages (Wladimir J. van der Laan)
ba46f39 init: Change fallback locale to C.UTF-8 (Wladimir J. van der Laan)

Pull request description:

  Backports the following PRs to the `0.19.0` [branch](https://github.com/bitcoin/bitcoin/tree/0.19):
  * bitcoin#17184 -  util: Filter out macOS process serial number
  * bitcoin#17131 - rpc: fix -rpcclienttimeout 0 option
  * bitcoin#17111 - doc: update bips.md with buried BIP9 deployments
  * bitcoin#17095 - util: Filter control characters out of log messages
  * bitcoin#17085 - init: Change fallback locale to C.UTF-8

ACKs for top commit:
  laanwj:
    ACK  334e27e

Tree-SHA512: 436064c00f98bae8475d0e46ab104df6fc9bdae4927dcdd5cffa4242704256c749352e9cabb23cf806911b1c303ddcb0208a42d540412e98da2513176e5e1023
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants