我一直在使用Lazarus 1.6.4和FPC 3.0.2编写一些代码,以便在Windows中获取用户名,在Linux中获取用户。为此,我使用了SysUtils.GetEnvironmentVariable函数。在Linux中,它工作得很完美,但在Windows中,它会返回一些看起来像是以错误编码打开的UTF8字符串的损坏内容。在Windows中,我的用户名包含西里尔字母,所以GetEnvironmentVariable返回的不是实际名称,而是????????,但它应该是Пользователь。下面是我的代码:
function GetUserName: string;
{$IFDEF MS
现在无法更新或安装任何东西,因为有几个软件包据称有未满足的依赖关系。
sudo apt-get upgrade:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-image-generic-hwe
我已经创建了一个bash脚本,并希望为WSL2的windows和linux部分提供一个动态文件路径。
#!/bin/bash
# Create the workspace
mkdir /mnt/c/Users/FINIX/Documents/Workspace/test/
# Go to the workspace
cd /mnt/c/Users/FINIX/Documents/Workspace/test/
# Create the temp file to store the branches
touch /home/finix/test.txt
# Clone the repo