请教下\x 开头的是啥编码? 站点日志好多这种, 也不像 url 和 utf8 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
proxychains
V2EX    问与答

请教下\x 开头的是啥编码? 站点日志好多这种, 也不像 url 和 utf8

  •  
  •   proxychains 2022-11-22 11:30:22 +08:00 1466 次点击
    这是一个创建于 1103 天前的主题,其中的信息可能已经有所发展或是发生改变。

    @timestampNov 22, 2022 @ 09:15:[email protected]_id6d0763e7-2caa-4560-945b-5fe36db0c7cdagent.id0905ccb1-6212-41de-b807-6b7c38583139agent.nameBKbQvh10443agent.typefilebeatagent.version8.4.0ecs.version8.0.0event.original71.1.1.1 - - [19/Jul/2022:15:03:12 +0800] "\x03\x00\x00/\xE0\x00\x00\x00\x00\x00Cookie: mstshash=Administr" 400 150 "-" "-"fields.tagnginx-tagloghost.nameBKbQvh10443input.typeloglog.file.path/var/wwwlogs/access.loglog.offset2,207message1.1.1.1 - - [19/Jul/2022:15:03:12 +0800] "\x03\x00\x00/\xE0\x00\x00\x00\x00\x00Cookie: mstshash=Administr" 400 150 "-" "-"tags[NGINX-ACCESS, beats_input_codec_plain_applied]_id23TmnIQBm8tgvL1Dd91O_indexaccess-logscore -

    5 条回复    2022-11-22 13:31:38 +08:00
    nightwitch
        1
    nightwitch  
       2022-11-22 12:36:23 +08:00 via Android
    纯字节表示,具体什么编码从一串字节里没法知道。 数了下有奇数个字节,大概率 utf-8
    sinksmell
        2
    sinksmell  
       2022-11-22 12:43:01 +08:00
    hello, 这个是 utf8 编码,将 \x 替换成 % 就得到了常见的 url encode / 百分号编码。

    ```shell
    $ python3
    Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> print ("\x03\x00\x00/\xE0\x00\x00\x00\x00\x00")

    >>>

    ```

    \x 后面跟的是 16 进制数字,可以还原成 []byte / []rune 从而得到原始字符串
    proxychains
        3
    proxychains  
    OP
       2022-11-22 13:07:10 +08:00
    @nightwitch 感谢回复
    proxychains
        4
    proxychains  
    OP
       2022-11-22 13:07:17 +08:00
    @sinksmell 感谢回复
    2NUT
        5
    2NUT  
       2022-11-22 13:31:38 +08:00   1
    hex
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     874 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 22:40 PVG 06:40 LAX 14:40 JFK 17:40
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86