Using UTF-8 locales in [B]LFS

OpenClaw部署实战:中文支持、飞书集成与Podman生产化落地 AI工作流框架(如OpenClaw)是构建可解释、可调试LLM应用的核心基础设施,其本质在于将黑盒推理转化为可控、可审计的工程化流程。理解其底层原理——包括模型服务隔离机制、多语言资源加载逻辑、以及企业级通信协议(如飞书Webhook双向认证)——是实现稳定落地的前提。技术价值体现在显著降低AI系统维护成本,支撑Agent链路复现、A/B测试及国产信创环境适配等关键场景。本文聚焦OpenClaw在真实生产环境中的部署实践,覆盖中文资源包集成、Podman+Systemd替代Docker Compose的架构 阅读详情
AUTHOR: Alexander E. Patrakov
DATE: 2003-11-06
LICENSE: Public Domain
SYNOPSIS: Using UTF-8 locales in [B]LFS
DESCRIPTION:
This hint explains what should be changed in the LFS and BLFS instructions
curent at the time of this writing in order to use locales such as ru_RU.UTF-8.

PREREQUISITES: LFS 5.1-pre1 or later, good knowledge of C
CONFLICTS: compressed manual pages

*** NOTE ***
This hint is not maintained by the author.
***

CHANGELOG:
2003-11-06: Initial submission
2004-02-25: Added some BLFS packages

HINT:

IMPORTANT INFORMATION

Don't follow this hint unless you are prepared to fix broken things! I never
had a full BLFS install, and of course because of that some packages that
are broken in UTF-8 locales may well be missing from this hint.

Also, please don't ask support questions related to this hint on mailing lists
hosted on linuxfromscratch.org (and of course don't provide support yourself)
if you can't answer the questions at the end of the hint.

Also note that while our goal is to move to the international UTF-8 encoding,
we have to disable internationalization completely in some older applications.
So this hint really becomes an antihint: we gain nothing except compatibility
with bleeding-edge RedHat-like distros in their default configuration, and
lost... lost what we were aiming to get --- internationalization.

Once again, don't follow this hint blindly.

BIG WARNING: you will probably have to convert ALL your documents.

Part 1. INTRODUCTION

1. Single-byte and double-byte encodings and UTF-8: what's wrong

Most Eropean languages have a relatively short alphabet (less than 40
characters). This makes it possible to create a represent the
characters of that alphabet (both upper-case and lower-case), English alphabet,
digits and punctuation with a single byte. The result is known as a single-byte
encoding. An example of such encoding is KOI8-R, commonly used in Russia. All
single-byte encodings are ASCII-compatible in the sense that characters
representable in ASCII are also representable in these encodings and have the
same code. They are also reverse-ASCII-compatible in the sense that every byte
with the value less than 0x7f represents the same character as it does in
ASCII. Current LFS and BLFS work well with such encodings.

This approach doesn't work with Asian languages such as Chinese, Japanese and
Korean (denoted together as CJK further in this hint). They have more than 256
different characters, because single characters represent syllables and even
words. So called double-byte encodings are used with these languages. They
represent English letters, digits and punctuation with single bytes equal to
ASCII representation of those characters. To represent native CJK characters,
two-byte sequences are used. Such encodings are called double-byte. An
example is GB2312, used in China. Since CJK characters are twice as wide as
English ones in monospaced font, the "on-screen" width of a string encoded with
such methods is directly proportional to the number of bytes in it (there is
one exception: any two-byte sequence starting with 0x8e byte in EUC-JP takes as
much space as an English letter). LFS and BLFS don't work well with Asian
languages and double-byte encodings because of two reasons:

1) It is impossible to display double-width characters on a Linux console (even
on a framebuffer console) without additional programs that are not in the book.
Installation of e.g. zhcon corrects this.

2) Some assumptions that work with single-byte encodings fail with double-byte
ones. First, some double-byte encodings are not reverse-ASCII-compatible: a
byte with value less than 0x7f can be either an ASCII-representable character
or a second byte of a two-byte sequence. Second, correctly finding the n-th
character in a string is a complex task because some characters occupy one
byte, and some characters are represented by two-byte sequences. Software that
makes bad assumptions needs to be either patched or not installed at all.

Today there is a need to encode multilingual texts. E.g., foreign clients of
companies don't want their names to be distorted up to unreconinzable state by
a chain of multiple transliterations. Since all single-byte and double-byte
encodings are capable of representing characters of at most two alphabets
(english + national), there is a need for a new character set to encode
multilingual texts. Such character set exists and it is named Unicode.

UTF-8 is a method of representing Unicode text with a stream of
8-bit bytes. The resulting stream is both ASCII-compatible and
reverse-ASCII-compatible. A single character can occypy from 1 to 4 bytes. Many
current distributions of Linux configure locales using the UTF-8 character
encoding by default. This doesn't work with (B)LFS for the same reasons as with
double-byte encodings. However,

1) There is no framebuffer-based terminal that is capable of displaying the
full range of Unicode characters (if one doesn't count Debian-specific bterm
from the "bogl" package, bogl = Ben's Own Graphics Library).
Fortunately, it is not needed in most cases. Linux console is capable of
displaying Latin (including accented), Greek, Arabian and Cyrillic
characters together even without framebuffer. Also, xterm works just fine.

2) There is one more assumption that breaks with UTF-8. The relation of
on-screen width of a string to the number of bytes in it is very complex.
That's why e.g. Midnight Commander works with double-byte encodings, but
doesn't work with UTF-8.

3) Many packages in UTF-8 locale fail to provide compatibility with older
doculents saved in traditional single-byte or double-byte encoding.

Part 1. LFS PACKAGES

1. Suggested changes to the installation instructions

The following packages should be configured differently in Chapter 6:
- ncurses
- vim
- man

1a. Modified Ncurses installation instructions

First of all, you need NCurses 5.4. Get it from

http://ftp.gnu.org/gnu/ncurses/ncurses-5.4.tar.gz

The new Ncurses version has experimental support for wide characters.
According to the output of ./configure --help, it is activated by passing
the --enable-widec argument to ./configure. The resulting libraries are
binary-incompatible with "normal" ncurses and therefore a letter "w" is
appended automatically to their names: libncursesw.so.5.4. For compatibility
with precompiled commercial applications, we will install two versions of
ncurses.

Now we are ready to install the non-wide-character version of ncurses, almost
by the book:

./configure --prefix=/usr --with-shared --without-debug
make
make install

This installs /usr/lib/libncurses.so.5.4. We will move it to /lib later.
Then install a wide-character-enabled version:

make distclean
./configure --prefix=/usr --with-shared --without-debug --enable-widec
make
make install

This installs /usr/lib/libncursesw.so.5.4 and related libraries.

Move important libraries to /lib and correct permissions:

chmod 755 /usr/lib/*.5.4
chmod 644 /usr/lib/libncurses++*.a
mv /usr/lib/libncurses.so.5* /lib
mv /usr/lib/libncursesw.so.5* /lib

Make the symbolic links:

ln -sf ../../lib/libncursesw.so.5 /usr/lib/libncurses.so
ln -sf libncurses.so /usr/lib/libcurses.so
ln -sf ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
ln -sf libncursesw.so /usr/lib/libcursesw.so

Note the first command. Now all applications trying to link at compile time 
against -lncurses will actually link to the wide-character version,
/lib/libncursesw.so.5. This works, because the two libraries are
source-compatible. At runtime, the linker will happily resolve the dependency
upon libncursesw.so.5. And for precompiled commercial applications that
depend on the ordinary version of ncurses there is /lib/libncurses.so.5.

1b. Modified Vim instructions

For Vim to work correctly in double-byte encodings and in UTF-8, the
--enable-multibye switch has to be added to the ./configure command line. Note
that it is not necessary in BLFS since --with-features= (more than normal)
implies this.

echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h
./configure --prefix=/usr --enable-multibyte
make
make install
ln -s vim /usr/bin/vi

Vim is able to edit files in arbitrary encodings if you use UTF-8-based locale.
E.g. to read the file price.txt that is known to be in CP1251 encoding, type:

:e ++enc=cp1251 price.txt

It will be automatically converted. To save the file in KOI8-R encoding under
the name price.koi, type:

:w ++enc=koi8-r price.koi

Vim is even able to automatically detect the character set of the file
being read under some conditions. This works because real texts in most
single-byte and double-byte encodings contain sequences of bytes that are not
valid in UTF-8.

This capability needs to be configured. To do so, create the file /etc/vimrc
with the following contents (replace koi8-r with the name of a single-byte or
double-byte encoding that is mostly often used in your country):

" Begin /etc/vimrc

set nocompatible
set bs=2
set fileencodings=ucs-bom,utf-8,koi8-r

" End /etc/vimrc

For more information, read /usr/share/vim/vim62/doc/mbyte.txt

1c. Modified Man instructions

Since Man internationalization does not work at all in UTF-8 locales (the
messages are still output in single-byte or double-byte encodings, appearing
as lines of unreadable squares on the screen) and because Russian messages are
improperly translated (and offensive!) we will disable NLS. This will not
prevent you from viewing manual pages in your native language. It just means
that messages like "What manual page do you want?" will remain untranslated.

Install the "man" package with the followiing commands:

patch -Np1 -i ../man-<version>-manpath.patch
patch -Np1 -i ../man-<version>-80cols.patch
patch -Np1 -i ../man-<version>-pager.patch

DEFS="-DNONLS" ./configure -default -confdir=/etc +lang all
make
make install

Now we have to decide what to do with manual pages in your native language.
They are provided with the corresponding packages in the single-byte or
double-byte encoding, but not in UTF-8. Therefore, they won't display properly.
There are two solutions to this problem.

The first solution is to store them in the single-byte or double-byte encoding,
i.e. as they come with the corresponding packages, and convert them into UTF-8
on the fly. To do this, search for the line in /etc/man.conf that starts with
"PAGER". Replace it with something like the following:

PAGER           /usr/bin/iconv -c -f koi8-r | /usr/bin/less -isR

(replace koi8-r with your 8-bit or double-byte encoding). Note that this change
does not hurt you if you later switch back to the usual encoding: iconv will
be a no-op. Unfortunately, this doesn't work well with graphical man page
viewers like Yelp (from GNOME-2.4) or Konqueror, since they just ignore the
"PAGER" variable in /etc/man.conf (if they read /etc/man.conf at all) and
assume that manual pages are stored in the character set of the current locale.

The second solution would be to convert manual pages to UTF-8. Unfortunately,
I had no success with this. RedHat provides some patches for groff-1.18.1.
I tried to convert all manual pages into UTF-8 and changed man.conf to have
the line

# WRONG!
NROFF /usr/bin/iconv -c -t koi8-r | /usr/bin/nroff -Tlatin1 -mandoc | /usr/bin/iconv -c -f koi8-r

This didn't work well because some manual pages contain just

.so filename

and don't display properly.

In fact, the *roff specification says that the input must be in iso8859-1
encoding, there is no way to typeset anything except Latin and Greek according
to the specification, and all localized manual pages (even in the single-byte
Cyrillic KOI8-R encoding!) are really a hack and violate the specification.

2. Setting up UTF-8 based locale and environment variables

Some UTF-8 locales (e.g. se_NO.UTF-8) are installed during the

make localedata/install-locales

step while installing glibc. But most of UTF-8 locales must be created
manually, e.g.:

localedef -c -i ru_RU -f UTF-8 ru_RU.UTF-8

The role of the -c switch is to continue the creation of the locale even though
warnings are issued. After the creation of the locale, it is needed to tell
applications to use it. All that is required is to set some environment
variables. An easy "solution" is to add this to your /etc/profile:

# WRONG!!!
export LC_ALL=ru_RU.UTF-8
export LANG=ru_RU.UTF-8

This "solution" is wrong because these variables will be available to processes
started from your login shell, but will not be available to the readline
library that the shell uses. The readline library uses this information e.g. to
determine how many bytes to remove from the input buffer (must be one UTF-8
character) and how many character cells to erase on the screen (again, one
full character) if you press Backspace or Delete key.

Yes, if you _type_ export LC_ALL=ru_RU.UTF-8 in the login shell, then it will
pass this setting to the readline library. But this doesn't work in the shell
startup files. This is a bug in bash. So the correct LC_ALL variable must be
already in the environment when the login shell starts.

If one adds the above LC_ALL and LANG variables into /etc/environment, it will
work for login shells started by the "login" program, but will not work for
shells started by "su" or "sshd" programs. This approach also requires you to
place these variables into /etc/profile so that they will be available from
KDE (the "startkde" script from KDE 3.2.0 sources /etc/profile).

Another approach is to make the login shell set the correct locale variables
and reexecute itself. To accompilsh this, add the following snippet at the
very beginning of your /etc/profile:

if [ "x$LC_ALL" = "x" ]
then
    export LC_ALL=ru_RU.UTF-8
    export LANG=ru_RU.UTF-8
    if ( echo $- | grep -q i )
    then
        exec -a "$0" /bin/bash "$@"
    fi
fi

The $- check is there because /etc/profile is sometimes sourced by other
scripts that run in noninteractive shells. Such shells don't need to be
reexecuted, since you don't want to replace a script that sourced /etc/profile
with an instance of /bin/bash called with the same parameters as the script.

Of course, you will have to replace ru_RU above with something more
appropriate.

If you are using xdm, you also want to include the following lines into the
beginning of /etc/X11/xdm/Xsession:

[ -r /etc/profile ] && . /etc/profile
[ -r $HOME/.bash_profile ] && . $HOME/.bash_profile

Consult the documentation of other display managers for the means to set the
environment in the started session.

3. Setting up Linux console

We will modify the /etc/rc.d/init.d/loadkeys script.

#!/bin/bash
# Begin $rc_base/init.d/loadkeys - Loadkeys Script

# Based on loadkeys script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# Modified for UTF-8 locales by Alexander E. Patrakov - semzx@newmail.ru

source /etc/sysconfig/rc
source $rc_functions

echo -n "Setting screen font..."
for console in /dev/tty[1-6]
do
    (
	setfont
	setfont LatArCyrHeb-16
    )<$console >$console 2>&1
done
evaluate_retval

echo -n "Loading keymap..."
kbd_mode -u
loadkeys ru1 2>/dev/null &&
dumpkeys -c koi8-r | loadkeys --unicode
evaluate_retval

# End $rc_base/init.d/loadkeys

Some comments concerning this script.

1) The empty "setfont" command works around a bug in 2.6 kernels.

2) We don't switch the console output to UTF-8 here. We will do that in
/etc/issue (the idea is stolen from "redhat-style-logon" hint). This is
necessary because otherwise this switching will affect only the first console.
As an alternative, you can write a "for" loop here sending <ESC>%G to all
virtual consoles.

3) The kbd package does not provide ready-to-use keymaps for UTF-8 locales,
except for Ukrainian one. First, we load the now-wrong ru1 keymap (the numeric
character codes there are valid only for koi8-r character set), then we dump
it replacing numeric codes with human-readable descriptions of characters (e.g.
"cyrillic_small_letter_e"). The resulting keymap is usable in UTF-8 mode, so
we load it with loadkeys --unicode.

Let's create /etc/issue:

echo -e '/033[2J/033[f/033%GWelcome to Linux From Scratch/n' >/etc/issue

The meaning of the escape sequences:
<ESC>[2J = clear entire screen
<ESC>[f = move the cursor to the corner of the screen
<ESC>%G = put the console into UTF-8 mode

Set up screen font and keyboard now, if you don't want to reboot:

/etc/rc.d/init.d/loadkeys

Then kill all agetty processes for them to reread /etc/issue:

killall agetty

4. Conclusion

From your next login, you will use UTF-8 based locale, with all its benefits
and drawbacks.

Known bugs:

- The Caps Lock key does not work on Linux console for national characters.
  The guilty package is kbd.
  
- Some packages don't display line drawing characters in UTF-8 mode on Linux
  console. This is a bug in the packages themselves. See ALSA section below
  for more detailed discussion.

Part 2. BLFS PACKAGES

1. GnuPG

The package itself is internationalized well and supports UTF-8 out of the box.
Unfortunately, some applications (e.g. Enigmail) assume that the output of gpg
is in iso8859-1. For applications that cannot be fixed easily, create the
following script:

#!/bin/sh
export LC_ALL=C
export LANG=C
exec /usr/bin/gpg "$@"

Save it as /usr/bin/gpg-nolocale, give it the "executable" bit and configure
the offending application to use this script instead of the real gpg binary.

2. Emacs

I don't use Emacs at all, but your comments are welcome. Don't expect
any console-based editor except Vim, Emacs and Yudit to work in UTF-8 locale.

3. Slang

Get the patch

http://www.linuxfromscratch.org/patches/downloads/slang/slang-1.4.9-utf8.patch

Install Slang using the following instructions:

patch -Np1 -i ../lang-1.4.9-utf8.patch
./configure --prefix=/usr
make CFLAGS="-O2 -pipe -DUTF8"
make install
make CFLAGS="-O2 -pipe -DUTF8" ELF_CFLAGS="-O2 -pipe -DUTF8" elf
make install-elf
make install-links
chmod 755 /usr/lib/libslang.so.1.4.9

WARNING: you should pass -DUTF-8 in CFLAGS to all applications that depend
on Slang.

4. Aspell

To be done.

5. GPM

GPM cannot cut/paste non-ASCII characters. It is really a limitation of Linux
console. You can google for a kernel patch named

unicode_copypaste_2.4.19.patch.gz

but I would recommend against it. I had crashes and repeatable kernel panics
with it.

6. Zip/Unzip

If you put a file with non-ASCII characters in its name into the archive, you
will be unable to get that name correctly under Windows.

7. Midnight Commander

First, install Slang. Then, get the patch

http://www.linuxfromscratch.org/patches/downloads/mc/mc-4.6.0-utf8.patch

Install Midnight Commander with the following instructions:

patch -Np1 -i ../mc-4.6.0-utf8.patch
CFLAGS="-O2 -pipe -DUTF8" ./configure /
    --prefix=/usr --with-screen=slang /
    
    --what-else-you want, e.g.
    
    --with-vfs --with-samba --enable-charset --without-ext2undel /
    --with-configdir=/etc/samba --with-codepagedir=/usr/share/samba/codepages
make
make install

Unfortunately, this patch is not sufficient. In particular, it is impossible
to view and edit files containing non-ASCII characters using the internal
viewer and editor. Configure Midnight Commander to use an external editor,
e.g. Vim.

8. w3m

You need w3m-m17n, not just a bare w3m. Unfortunately, w3m-m17n-0.4.2 does not
exist yet.

9. Mutt, Pine

I don't use them at all, but Debian has a patch for Mutt.
Your comments are welcome.

10. GTK+-1.2.10

This package's default style files in /etc/gtk don't work in UTF-8 locales.
Changing "koi8-r" to "iso10646-1" fonts in /etc/gtk/gtkrc.ru fixes the problem
with improper fonts for Russians. Beware that KDE also sets GTK styles (in
~/.kde/share/config/gtkrc and ~/.gtkrc), so these files also may need some
manual editing.

11. LessTif

This package does not support UNICODE well.

12. KDEMultimedia

The players show ID3 tags with national characters improperly.

13. Yelp

The problems with manual pages have already been mentioned in Man section.

14. ALSA

Alsamixer 1.0.2 won't show the line drawing characters on Linux console in
UTF-8 mode. This is a bug in alsamixer. The problem is that NCurses must
know whether the Linux console is in UTF-8 mode or not. To do that, NCurses
checks the current locale setting (in the order: LC_ALL, LC_CTYPE, LANG).
Also, it has to compute how many cells a given character occupies. This
requires a valid LC_CTYPE setting.

But this means that a program that links to ncurses must call

setlocale(LC_CTYPE, "")

before initscr(). This patch fixes the issue in alsamixer

http://www.linuxfromscratch.org/patches/downloads/alsa-utils/alsa-utils-1.0.2-locale.patch

After reading the text above and looking at the alsamixer patch, you should
be able to fix this kind of a problem with other packages. Please send
patches to patches@linuxfromscratch.org.

Don't send a patch for the "lxdialog" program that comes with the kernel
sources and is used during "make menuconfig", since that will break Question
2 in the quiz below and I will no longer be able to check whether others are
ready to follow this hint.

15. XMMS

This package will not show ID3 tags properly out of the box, because they are
usually in the windowsish single-byte or double-byte encoding and not in UTF-8.
The patch from http://rusxmms.sourceforge.net/ helps.

16. Dillo

This package does not support UNICODE.

17. XSane

The gtk+-1.2.10 version is affected by a bug in gtk+ style support
and does not work properly even in ru_RU.koi8r locale. To work around
the problem, don't build the GIMP plugin --- then XSane will link against GTK2.

18. Xpdf

Since this package depends on LessTif, the support of UTF-8 in the GUI is
rather poor. E.g., the filenames in the fileselector show improperly. But
the non-GUI tool, pstotext, works flawlessly and can extract text in the UTF-8
encoding from PDF files.

19. A2ps

This package does not support UNICODE.

20. TeX

To use UTF-8 as an input encoding with TeX, you should download the following
package:

http://www.unruh.de/DniQ/latex/unicode/unicode.tgz

Just unpack it into /usr/share/texmf/tex, remove all files except

ucs/*.sty, ucs/*.def, ucs/data/*

and then run mktexlsr. Then you will be able to write

/usepackage[utf-8]{inputenc}

in the document preamble, but I doubt that anyone else will be able to TeX
your documents.

If you want someone else to be able to extract text in UTF-8 encoding from
your PDF files generated by PDFTeX or dvipdfm, you should also install
the "cm-super" font package from CTAN.

Part 3. CONCLUSIONS

Probably you understand from reading the above that UTF-8 causes more trouble
than merit. If you followed this hint, I hope that I didn't damage your system
irreversibly.

Please post your deviations and report other broken packages to

patrakov@ums.usu.ru

APPENDIX A. QUIZ

You should follow the hint only if you know all the answers.

1) The non-wide character version of ncurses 5.4 uses poor-man line-drawing
   characters on Linux console in UTF-8 mode.

   What other terminal type is affected by this? Where (which file and line)
   is the check? Where is the piece of code that substitutes these poor-man
   line-drawng characters instead of those which came from the terminfo
   database? Where does ncurses 5.4 check the current locale?

2) Linux kernel build process uses the "lxdialog" program during the
   "make menuconfig" step. Unfortunately, lxdialog has the same bug as
   alsamixer (see the hint).
   
   Can you make a patch for lxdialog yourself?
Ubuntu-base构建自定义Linux根文件系统指南 Linux根文件系统(rootfs)是操作系统运行的基础环境,包含所有必要的二进制文件、库和配置文件。通过Ubuntu-base构建自定义rootfs,开发者可以利用成熟的APT包管理系统快速部署嵌入式系统。这种方法相比传统方案如BusyBox或Yocto,提供了更完善的软件生态和架构支持。在ARM和x86_64等不同处理器架构上,结合QEMU模拟技术可实现跨平台开发。这种技术方案特别适合需要快速原型开发的物联网设备和嵌入式系统,能显著降低构建门槛并提高开发效率。 阅读详情

相关推荐

通义千问3.0开源深度解析:中文语义压缩与工业级落地实践

大语言模型的中文能力本质是语义理解与工程适配的结合体。从基础概念看,中文NLP需应对语法模糊性、虚词敏感性及领域术语强约束;其技术原理在于语料清洗粒度、动态量化机制与意图对齐协议的协同优化;核心价值体现在降低私有化部署门槛、提升政务/金融/制造等垂直场景的推理稳定性与合规性;典型应用场景包括合同条款比对、判决书结构化、设备说明书生成及基层政务智能问答。本文聚焦Qwen3.0开源版本,深入剖析其中文语义压缩(Qwen-Quant-MS)、脏数据驯化策略与Tongyi-Tool-Align工具调用协议三大关键技

weixin_30800987的博客 333

报错grep: -P supports only unibyte and UTF-8 locales

【代码】报错grep: -P supports only unibyte and UTF-8 locales。

Home to come 1387

Unity机器人仿真环境搭建:从游戏引擎到高保真算法验证平台

机器人仿真技术是算法开发和系统验证的关键环节,它通过在虚拟环境中模拟真实物理规律和传感器数据,为控制、导航和感知算法提供安全、高效的测试平台。其核心原理在于集成物理引擎、图形渲染与通信接口,构建一个可交互的数字化孪生体。这项技术的价值在于大幅降低硬件试错成本、加速研发迭代,并支持复杂场景的快速构建与复现。在应用场景上,它广泛服务于自动驾驶、工业机械臂、无人机集群以及基于视觉的AI训练等领域。本文聚焦于利用Unity引擎搭建机器人仿真环境,深入探讨了其相较于传统工具(如Gazebo)在图形渲染、资源生态和与R

weixin_33901926的博客 555

UTF-8 and Unicode FAQ for Unix/Linux

UTF-8 and Unicode FAQ for Unix/Linux作者 Markus Kuhn 原文地址:http: //www.cl.cam.ac.uk/~mgk25/unicode.html译者:Love.Katherine,2007-8-30译文地址:http://blog.youkuaiyun.com/lovekatherine/archive/2007/08/30/1765

暗恋的滋味 2万+

Codex本地安装全平台避坑指南:绕过官网访问与系统拦截

Codex作为一款面向开发者的本地AI编程代理工具,依托Llama 3、DeepSeek-Coder等开源模型实现代码理解与生成,其核心价值在于离线可用、隐私可控和模型可替换。技术原理上,它通过Ollama/vLLM加载GGUF格式模型,由Electron/Tauri封装前端交互,形成端到端的本地智能编码工作流。在实际落地中,‘ofox.io无法访问’和‘安装包报错’成为高频阻塞点,本质是SNI识别拦截、二进制签名缺失与运行时依赖不兼容三重问题叠加所致。本文聚焦真实工程场景,覆盖macOS Gatekeep

weixin_34295316的博客 360

QEMU pcie config空间访问机制

而pci_host_conf/data_le_ops的定义是在hw/pci/pci-host.c里,对于0xCF8端口的处理,因为是地址选通,所以只需要在write的时候记录、read的时候返回记录的值即可。而pci_host_config_write/read_common接口,在前256Bconfig空间的模拟中,也同样是会调用这个接口,所以后续的处理都是一样的。这是真实的硬件设计,而对于QEMU+KVM的虚机场景,显然是要基于硬件实现和虚拟化的需求设计虚机访问config空间的完整流程。

leiyanjie8995的博客 1950

mac系统 grep不支持-P选项的解决办法,grep匹配utf8中文字符

文章目录需求:找出文件中所有的中文各系统集成的grep区别mac系统centos系统经验mac如何才能做到查找文本中的所有中文呢?扩展,linux查看二进制,16进制的命令grep如何匹配文本中的所有中文字符呢?参考 需求:找出文件中所有的中文 找出代码中所有的中文,而非指定的几个中文单词 各系统集成的grep区别 mac系统 /usr/local/var » grep --version ...

杜绝996的web开发man 8979

别再手动查日志了!用Dify+Zabbix打造你的专属运维“嘴替”(保姆级配置流程)

本文详细介绍了如何利用Dify平台与Zabbix监控系统集成,构建智能运维对话系统,实现自然语言交互的运维管理。通过保姆级配置流程,帮助运维工程师提升查询效率、降低学习成本,打造企业级智能运维解决方案。

weixin_27298377的博客 456

【命令操作】Linux三剑客之grep详解 _ 统信 _ 麒麟 _ 方德

Hello,大家好啊!今天带来一篇关于Linux三剑客之grep命令详解的文章。在日常的Linux操作中,grep是一个非常强大的文本搜索工具,它可以帮助我们快速定位文件中包含特定关键字的行,不论是在系统日志排查、配置文件搜索,还是数据处理分析中,都能起到重要作用。 本文将详细介绍grep命令的使用方法及其实际应用场景,帮助大家快速掌握这款工具的精髓。欢迎大家分享转发,点个关注和在看吧!

鹏大圣运维 1335

手把手教你获取全国街道级GeoJSON数据:前端地图开发必备技巧

本文详细介绍了获取全国街道级GeoJSON数据的多种方法,从前端地图开发的实际需求出发,涵盖了免费获取省市县级数据的工具如阿里云DataV.GeoAtlas和HashTang,以及进阶的街道级数据获取方案,包括使用Bigemap GIS Office和专业数据采购。文章还提供了数据处理与优化技巧,帮助开发者高效使用GeoJSON数据进行地图可视化。

weixin_29053383的博客 289

树莓派使用 OLED 屏显示图片及文字

树莓派默认是不带显示屏的,如果想要查看系统的一些信息,需要使用电脑登录到树莓派,或者通过 HDMI 连接外接显示器查看。这样做总是有点麻烦,我们可以通过外接一个 OLED 屏来显示一些关键参数或者图片。本文将详细介绍操作方法。 OLED 模组介绍 OLED 屏主要有两种:128×32 和 128×64 ,主要颜色是白、黄、蓝。OLED 屏的特点是功耗低,价格便宜,使用 I2C 接口与主机连接。本文所使用的是 128×64 尺寸的屏幕,外形如下: [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直

码到成功 3742

Unicode 和 UTF-8

Unicode 和 UTF-8 有什么区别?

嵌入式技术 2197

手把手教你配置UFS的PSA状态机:WRITE/UNMAP命令实战与LBA映射避雷

本文详细解析了UFS PSA状态机的配置流程,重点探讨了在Pre-soldering状态下WRITE命令的原子性操作原则与单次写入LBA的重要性。通过实战代码示例,指导开发者如何正确初始化PSA环境、切换状态机,并深入剖析了使用UNMAP命令清理LBA映射时的常见陷阱与避雷指南,确保量产数据安全与良率。

weixin_29213525的博客 419

WSL-Ubuntu环境配置与开发实战指南

Windows Subsystem for Linux (WSL) 是微软推出的Linux兼容层技术,通过在Windows内核中实现系统调用转换,使原生Linux二进制文件能在Windows上运行。其核心原理是轻量级虚拟化技术,相比传统虚拟机节省90%以上的资源开销。WSL 2采用完整的Linux内核,特别适合需要Linux开发环境但主要使用Windows的开发者。典型应用场景包括Python开发、C++编译、Docker容器管理等。本文以Ubuntu发行版为例,详解WSL环境配置技巧,包括文件系统互通方案

weixin_30797199的博客 483

生成式引擎优化(GEO)- 搜索引擎优化

生成式引擎优化(GEO)是针对AI内容生成平台(如ChatGPT)的新型优化策略,旨在提升品牌内容在AI生成答案中的引用率,与传统SEO存在显著差异。GEO通过优化内容权威性、结构化和语义关联,适应AI的RAG技术架构,采用3C原则(可爬性、网络共识、反馈校正)提升内容可见性。其核心区别在于目标(引用率vs排名)、技术(语义优化vs关键词)及算法透明度(封闭vs开放)。适用场景包括商业决策、行业权威建设及公共知识服务,帮助品牌在AI时代占据信息主导权。

解锁AI流量新红利!🚀 GEO优化(生成引擎优化)助您掌控AI搜索,让AI成为您的品牌最佳代言人! 1399

STM32(HAL库)驱动HC-SR04测距模块

本文介绍通过STM32F103C8T6单片机对HC-SR04测距模块进行驱动,并且通过串口对数据进行打印。

weixin_44597885的博客 2203

WSL2 + Docker Desktop 4.27:Windows 11本地PyTorch GPU环境5分钟部署指南

本文详细介绍了如何在Windows 11上使用WSL2和Docker Desktop 4.27快速部署支持GPU加速的PyTorch开发环境。通过5分钟的配置步骤,开发者可以获得接近Linux原生的深度学习体验,包括环境准备、Docker配置、PyTorch容器部署及性能优化技巧,显著提升开发效率。

weixin_34007906的博客 759

Fiori Elements 表格之 Tree Tables:从数据建模到交互行为的全链路剖析

SAP Fiori elements的Tree Table组件将分层数据以表格形式展示,支持展开/折叠操作,适用于组织结构、物料清单等多级数据场景。该组件在List Report和Object Page中均可使用,支持懒加载、多选、列冻结等标准表格功能,并与OData V4服务层级注解深度集成。后端需通过RAP或CAP建模提供层级数据,前端通过清单配置切换表类型。需注意在草稿模式下仅显示活动实体,且展开状态在编辑时不保留。性能方面建议采用懒加载策略,避免全量加载树节点。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 159

机器人开发核心技术:从ROS 2环境搭建到感知-决策-控制闭环实践

机器人技术是人工智能与自动化领域的重要分支,其核心在于构建一个完整的感知-决策-控制闭环系统。从技术原理上看,机器人系统通常基于机器人操作系统(如ROS/ROS 2)进行开发,通过传感器(如激光雷达、摄像头)进行环境感知,利用算法(如SLAM、路径规划)进行决策,最终通过控制器执行动作。这一技术框架在自动驾驶、工业自动化、服务机器人等场景中具有极高的工程价值。本文以机器人算法开发为例,详细介绍了如何基于ROS 2和Python搭建开发环境,并通过一个巡线算法的仿真案例,具体演示了从传感器数据模拟、状态决策到

weixin_34409357的博客 411

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

揭秘人形机器人“特斯拉模式”:端到端神经网络控制与数据闭环实践

在机器人技术领域,端到端神经网络控制正成为一种颠覆性的技术范式。其核心原理在于,通过深度神经网络模型,直接将传感器原始数据映射为执行器的控制指令,从而替代了传统的模块化控制流程。这种数据驱动的技术价值在于,它能更好地处理真实世界中的复杂、不确定和长尾场景,为实现通用机器人的智能化提供了新的路径。其典型的应用场景包括动态环境下的自主导航、灵巧操作以及需要高度适应性的移动任务。本文以人形机器人为例,深入探讨了如何构建以视觉为主的多模态感知系统和数据驱动的迭代闭环,这正是当前行业领先公司所采用的“特斯拉模式”的核

weixin_34037515的博客 389

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

ROS2阿克曼底盘仿真:小米SU7模型与Nav2导航集成实战

机器人仿真技术通过构建虚拟物理环境,为算法验证提供了低成本、可重复的测试平台。其核心原理在于利用物理引擎模拟真实世界的动力学与传感器行为,并通过标准接口与上层算法栈通信。这一技术显著降低了自动驾驶与移动机器人领域的研发门槛与风险,使开发者能够在部署实车前充分验证路径规划、SLAM等核心模块。在ROS2生态中,Gazebo作为主流仿真工具,与Nav2导航栈深度集成,形成了从控制、感知到决策的完整测试闭环。本文聚焦于阿克曼转向底盘这一常见车辆模型,结合小米SU7的精细外观,详细演示了如何搭建仿真环境、验证控制接

weixin_33912246的博客 477

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

工业具身智能落地的核心:构建稳定可靠的智能底座

在机器人技术与人工智能融合的背景下,工业自动化正从传统的程序控制向感知决策一体化的具身智能演进。其核心原理在于通过多模态传感器感知环境,结合AI模型进行实时决策与运动规划,从而实现自主操作。这一技术的核心价值在于提升生产线的柔性、适应性与智能化水平,能够应对非标准化场景与动态任务需求。然而,要将实验室算法转化为稳定可靠的工业生产力,关键在于构建一个承上启下的基础设施——工业具身智能底座。该底座通过硬件抽象层统一管理异构设备,利用数据与模型服务层提供持续的智能燃料,并借助任务编排层实现多机协同与工作流调度。正

weixin_34218579的博客 387

人形机器人规模化开发:协同进化论下的软硬协同框架与实践

在机器人技术领域,系统集成与工程化落地是核心挑战。其原理在于通过模块化设计、标准化接口和统一工具链,将复杂的硬件、软件和算法解耦,实现高效协同开发。这一技术价值在于显著提升开发效率、降低集成调试成本,并增强系统的可靠性与可维护性。其应用场景广泛覆盖了从工业自动化到服务机器人的各类具身智能系统。本文聚焦于“协同进化论”这一新兴路径,它倡导硬件、软件与算法在统一框架下共同迭代,并通过ROS 2、URDF、数据闭环等具体技术,构建了从硬件抽象到智能应用的三层架构,为解决人形机器人规模化应用中的“集成地狱”和“仿真

weixin_34392435的博客 345

grep命令的-P选项及使用方法简介

grep命令的-P选项及使用方法简介

phmatthaus的专栏 7637

Linux下grep搜索不同编码格式(GBK/UTF-8)的中文

一般情况下linux默认是utf-8的编码格式,但windows下是GBK或GB2312格式的编码,以及source insight不支持utf-8,通过共享的形式编辑linux里的代码会保存成GB2312格式,这样通过grep -rn '中文' * 是无法把GB2312格式文件中的‘中文’检索出来的。 网上搜索很多,主要是说:当要查找汉字“中文”(utf-8编码和gb2312编码分别是E4B8ADE69687和D6D0CEC4)时,使用grep -rnP "\xE4\xB8\xAD\xE...

CCVVF的博客 7577

解决Using ‘UTF-8‘ encoding to copy filtered resources. [INFO] Using ‘UTF-8‘ encoding to copy filtered

在进行springboot的项目打包的时候,出现了这样的报错: 重点在中间两行,使用'UTF-8'编码复制过滤资源。 也就是说我们现在使用的编码格式是有问题的,那么我们就应该配置一下我们项目的编码方式,我在网上找到了几种解决办法,然后都试了试,把我经过尝试确认可以解决的方案分享给大家,解决方案一:配置编码格式为UTF-8 但是这种方式我尝试了之后没有用,但是很多朋友的项目使用这种方式还是可以解决的,所以我推测这个应该是和版本有关系的。具体的操作就是在pom.xml文件中的

listeningdu的博客 4462
上一篇: How to download the LFS tarballs via eDonkey
下一篇: Down the Rabbit-Hole
阿里教主
博客等级 码龄22年 12粉丝 30原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值