Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lixuedong
V2EX  ›  Linux

遇到一个 Linux 中文排序的问题 ,劳驾懂的大佬指点一下

  •  
  •   lixuedong · Dec 4, 2018 · 3135 views
    This topic created in 2744 days ago, the information mentioned may be changed or developed.

    嵌入式 linux
    在写一个文件名排序的代码
    在 PC 端排序正常 移植到板子里就不好使了
    反复测试了之后 发现 ls 出来的文件顺序也不是正常的
    如图所示
    sort 在开发板中排序和 ls 一样 不正常
    是内核驱动中文不友好还是缺少什么系统级的东西
    请有经验的大佬指点一下
    如图所示

    4 replies    2018-12-05 10:12:50 +08:00
    thedrwu
        1
    thedrwu  
       Dec 4, 2018 via Android   ❤️ 1
    有些系统中( fedora 说你呢),LANG,LC_* 这些会影响到排序和正则匹配。
    leoxiao2015
        2
    leoxiao2015  
       Dec 4, 2018   ❤️ 1
    google 一下 LC_COLLATE
    leoxiao2015
        3
    leoxiao2015  
       Dec 4, 2018
    你贴一下两个系统的 locale 命令的结果
    lixuedong
        4
    lixuedong  
    OP
       Dec 5, 2018
    @leoxiao2015 这是个精简的 linux 系统没有这个命令,我想办法看一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4708 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 09:47 · PVG 17:47 · LAX 02:47 · JFK 05:47
    ♥ Do have faith in what you're doing.