AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题

问题[utf-8](computer)

Martin Hope
Paul
Asked: 2023-07-22 07:10:19 +0800 CST

当文件是 utf-8 文本时,cli 程序 `less` 将文件解释为二进制文件

  • 5

我有一个文件,其中包含非 ASCII、UTF-8 字符。当我用来less查看该文件时,我收到一条警告说may be a binary file. See it anyway?但该文件显然不是二进制文件。当我打开文件时,字符未正确呈现。是什么让人们不太相信该文件是二进制的?另外,请注意,这些文件还有更多行纯 ASCII 文本,为简洁起见,我已将其删除。这是一个重现该行为的半最小示例。

更多背景:

$ cat broken.log
⋮
⋮ =✓)
$ head broken.log
⋮
⋮ =✓)
$ less broken.log
"broken.log" may be a binary file.  See it anyway?

<E2><8B><AE>
<E2><8B><AE> =<E2><9C><93>)
broken.log (END)

$ file broken.log
broken.log: UTF-8 Unicode text

操作系统:

$ cat /etc/os-release  
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

LESS:我很确定它是版本 487-0.1。

环境:

$ env | grep LANG
LANG=en_US.UTF-8
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
$ which less
/usr/bin/less
$ ls -la $(which less)
lrwxrwxrwx 1 root root 9 Jul 20 15:49 /usr/bin/less -> /bin/less
$ ls -la /bin/less
-rwxr-xr-x 1 root root 166664 May  7  2018 /bin/less
$ type -a less
less is /usr/bin/less
less is /bin/less
utf-8
  • 1 个回答
  • 31 Views
Martin Hope
Xavi Montero
Asked: 2022-10-11 06:24:52 +0800 CST

当字符串包含某些 UTF-8 字符时,用于计算 Google 电子表格中字符串长度的函数

  • 6

此函数返回 6,预计返回 4:

=LEN("?A?B")

如果 UTF-8 图标映射中的一个符号是 1 个字符,我应该使用什么函数来获取“真实字符数”?

utf-8 google-spreadsheets
  • 1 个回答
  • 16 Views
Martin Hope
einpoklum
Asked: 2020-03-10 04:44:59 +0800 CST

获取“警告:字符串到 FontSet 转换中缺少字符集”

  • 9

我正在使用 X 应用程序通过 SSH 连接到某台机器。当我运行一个 X 应用程序时,比如说,xclock为了简单起见,我会收到一条控制台消息:

Warning: Missing charsets in String to FontSet conversion

...但应用程序运行。我的语言环境是:

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

现在,我发现这个旧建议只是 set export LC_ALL=C。并且-有效,错误消息消失了。但是,我真的不想那样改变我的语言环境!

我可以做些什么来避免错误并保留我的语言环境吗?

附加信息:

  • X 服务器是 MobaXterm 在 Windows 上的集成 X 服务器。
  • 远程机器是 SLES GNU/Linux 11(由 SUSE)。
utf-8 locale
  • 1 个回答
  • 3965 Views
Martin Hope
Phoenix
Asked: 2020-01-22 17:17:06 +0800 CST

使用记事本时,我的 HTML 中出现的这些未知符号是什么?

  • 9

我在编写 HTML 时可以在记事本中找到这些字符。它绝对给我带来了问题。我连删都删不掉!

那么有谁知道这个符号是或为什么会出现?我试过谷歌它,它找不到它。

我的HTML如下:

<td class="ti"> 冰箱 </td>
<td> bīng xiāng </td>
<td> Freezer </td>

这里有两个屏幕截图向您展示我所看到的。

这是它在 Firefox 中的样子:

火狐

这就是它在 Google Chrome 中的样子:

谷歌浏览器

utf-8 notepad
  • 1 个回答
  • 631 Views
Martin Hope
Chameleon
Asked: 2019-09-15 03:06:02 +0800 CST

流行的 FTP 客户端无法自动检测到 VSFTPD 提供 UTF-8 文件名

  • 6

我运行 vsftpd 3.0.3 / armv7l / Debian 9.11 / Kernel 4.14.133+

有些路径有希腊字符。

在文件/etc/vsftpd.conf中有一行utf8_filesystem=YES,但也是默认行为。

在客户端的字符集自动检测模式下:

Chrome、Opera、Total Commander 理解使用 UTF-8 字符的路径。

Firefox、FileZilla、Double Commander 不理解使用 UTF-8 字符提供的路径,并且每个希腊字符显示 2 个字符。如果我将字符集强制为 UTF-8,一切正常。

我不确定这种错误行为是客户端的。我相信(!)没有错误的客户,只是在字符集上有一个故障安全机制。

这是一个小问题,但我以外的客户用户可能会感到沮丧。

波纹管是 Filezilla 日志,连接:

Status: Connecting to 192.168.1.2:21...
Status: Connecting to 192.168.1.2:21...
Status: Connection established, waiting for welcome message...
Response: 220 (vsFTPd 3.0.3)
Command: AUTH TLS
Response: 530 Please login with USER and PASS.
Command: AUTH SSL
Response: 530 Please login with USER and PASS.
Status: Insecure server, it does not support FTP over TLS.
Command: USER videos
Response: 331 Please specify the password.
Command: PASS 
Response: 230 Login successful.
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Features:
Response:  EPRT
Response:  EPSV
Response:  MDTM
Response:  PASV
Response:  REST STREAM
Response:  SIZE
Response:  TVFS
Response: 211 End
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (192,168,1,2,204,166).
Command: LIST
Response: 150 Here comes the directory listing.
Response: 226 Directory send OK.
Command: PASV
Response: 227 Entering Passive Mode (192,168,1,2,73,251).
Command: LIST -a
Response: 150 Here comes the directory listing.
Response: 226 Directory send OK.
Status: Directory listing of "/" successful

还有一个图像,文件路径如何显示:

在此处输入图像描述

utf-8 ftp
  • 1 个回答
  • 2284 Views
Martin Hope
psoft
Asked: 2019-04-06 13:47:45 +0800 CST

使用 Microsoft Word 保存不带 BOM 的 UTF-8 文件

  • -1

我想使用 Microsoft Word(特别是在 PC 上)打开、编辑并再次保存 UTF-8 格式的纯文本文件,但不在开头添加 BOM 字符序列。

让我们继续假设我询问的是关于 Word 2010 之后的任何版本的 Word。

我在“另存为”对话框中看不到执行此操作的选项,在我能看到的任何其他地方也看不到。

我可以看到这个问题多次被问到关于其他程序的问题,但我没有看到任何特定于 Word 的问题。

utf-8 microsoft-word bom
  • 1 个回答
  • 1421 Views
Martin Hope
MCK
Asked: 2019-04-02 06:32:14 +0800 CST

是否可以使用文本创建二维码?

  • 126

我见过的二维码大多是图片文件。但是您可以使用纯文本创建 QR 码吗?

例如 ASCII 和 UTF-8 以黑框作为字符。我可以将它们与空格一起使用来创建二维码吗?

utf-8 qr-code ascii
  • 2 个回答
  • 20608 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve