如何修复IBM解码未正确解码的RTL字符串?

发布于 2025-01-21 05:40:51 字数 649 浏览 0 评论 0原文

在阅读DB2的RTL字符串的IBM i使用C#时,我有问题。 我尝试在IBM上启用双向字符串,我的客户端访问与 there

我正在使用IIS 10。

因此,他们似乎写了一个修复字符串的功能。但是我遇到了麻烦,因为琴弦混合了希伯来语和英语,而且单词也不是正确的顺序。

我尝试逆转整个字符串,然后重新逆转拉丁语和数字字符,有时最终字母仍然围绕着开始。我将继续尝试使它正确,但希望解决此问题的算法已经存在……我找不到它。

我发现的是,当将console.outputencoding设置为encoding.utf8时,似乎可以修复所有内容,因为控制台打印实际上是完美的。有人知道这是如何或为什么吗?

tl; dr:双向字符串返回相反,但只有非英语碎屑和括号(我认为,不清楚)。关于修复的想法吗?

I have an issue when reading RTL strings from Db2 for IBM i using C#.
I tried enabling the bi-directional strings on IBM i Client Access and have the same issue as here.

I am using IIS 10.

So they seem to have written a function that fixes the strings; but I am having trouble because the strings have mixed Hebrew and English, and the words are not in the right order as well.

I tried reversing the whole string and then re-reversing the Latin and numeric characters, and sometimes the final letter still wraps around to the start. I'll keep trying to get it right but hopefully the algorithm to fix this is already out there... I can't find it.

What I did find is that when setting Console.OutputEncoding to Encoding.UTF8 it seems to be able to fix everything since the console printing is actually perfect. Does anyone have an idea how or why that is?

tl;dr: bi-directional strings are returning reversed, but only the non-English bits and brackets (I think, not clear). Any ideas on fixes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掩于岁月 2025-01-28 05:40:51

将应用程序池IIS用户设置为本地用户,而默认情况下解决了问题。
转到ApplicationPools - >选择您的应用程序池 - >高级设置 - >过程模型 - >身份 - >当您悬停值时...>自定义用户。

输入本地用户凭据,对我有用

Setting the Application Pool IIS user as a local user rather then the default solved the problem.
Go to ApplicationPools -> Choose your application pool -> Advanced Settings -> Process Model -> Identity -> the ... when you hover the value -> Custom User.

Type in a local user credentials and it worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文