本文将带您了解关于使用Delphi2007解码UTF-8编码的西里尔文的新内容,另外,我们还将为您提供关于C++wcoutunocode(西里尔文,日文)、c#–如何将已经两次UTF-8编码的字符串解
本文将带您了解关于使用Delphi 2007解码UTF-8编码的西里尔文的新内容,另外,我们还将为您提供关于C ++ wcout unocode(西里尔文,日文)、c# – 如何将已经两次UTF-8编码的字符串解码为简单的UTF-8?、Delphi 2007 x Windows 10 - 打开项目时出错 (Delphi 2007 x Windows 10 - Error on opening project)、Delphi 2007在64Windows系统出现 delphi 2007 assertion failure thread32.cpp 的解决方法的实用信息。
本文目录一览:- 使用Delphi 2007解码UTF-8编码的西里尔文
- C ++ wcout unocode(西里尔文,日文)
- c# – 如何将已经两次UTF-8编码的字符串解码为简单的UTF-8?
- Delphi 2007 x Windows 10 - 打开项目时出错 (Delphi 2007 x Windows 10 - Error on opening project)
- Delphi 2007在64Windows系统出现 delphi 2007 assertion failure thread32.cpp 的解决方法
使用Delphi 2007解码UTF-8编码的西里尔文
ga:referralPath=/add/%D0%9F%D0%B8%D0%B6%D0%B0%D0%BC
当我使用this decoder对其进行解码时,它会正确生成:
ga:referralPath=/add/Пижам
有没有我可以在Delphi 2007中使用的函数来执行这种解码?
UPDATE
该数据对应于URL.最终我想要做的是将它存储在sqlServer数据库中(开箱即用 – 没有针对字符集修改设置).然后能够生成/创建一个带有此页面工作链接的html页面(注意:我只处理此示例中的url引用路径 – 显然要创建一个有效的url链接,需要一个源代码).
解决方法
URL包含百分比编码的UTF-8字节八位字节.只需将这些序列转换为二进制表示,然后使用UTF8Decode()将UTF-8数据解码为WideString.例如:
function HexToBits(C: Char): Byte; begin case C of '0'..'9': Result := Byte(Ord(C) - Ord('0')); 'a'..'f': Result := Byte(10 + (Ord(C) - Ord('a'))); 'A'..'F': Result := Byte(10 + (Ord(C) - Ord('A'))); else raise Exception.Create('Invalid encoding detected'); end; end; var sURL: String; sWork: UTF8String; C: Char; B: Byte; wDecoded: WideString; I: Integer; begin sURL := 'ga:referralPath=/add/%D0%9F%D0%B8%D0%B6%D0%B0%D0%BC'; sWork := sURL; I := 1; while I <= Length(sWork) do begin if sWork[I] = '%' then begin if (I+2) > Length(sWork) then raise Exception.Create('Incomplete encoding detected'); sWork[I] := Char((HexToBits(sWork[I+1]) shl 4) or HexToBits(sWork[I+2])); Delete(sWork,I+1,2); end; Inc(I); end; wDecoded := UTF8Decode(sWork); ... end;
C ++ wcout unocode(西里尔文,日文)
在我的应用程序中,我使用西里尔文和日文字符。 当我使用:
_setmode(_fileno(stdout),_O_U16TEXT).
在操作系统Windows上 – 我的输出数据如下所示:
西里尔文:Привет
日语:
可能是什么问题呢?
Python控制台菜单使用字典
如何检测控制台或Windows应用程序?
编写在Windows下的Java应用程序中生成的C ++控制台应用程序
如何在Windows上正确地将拉丁字符打印到C ++控制台?
侏儒terminal,如何开始在不同的目录?
C ++ AttachConsole包含错误
了解Python中的编码和解码
将控制台输出redirect到unix中的文件
隐藏控制台时只py-file(没有pyw)
如何在“top”linux命令中执行控制台input?
您必须在您的计算机上安装日语语言环境。
对于你的操作系统,即Windows,请点击这里 。
这是Windows的语言环境列表。
c# – 如何将已经两次UTF-8编码的字符串解码为简单的UTF-8?
例如,“Újratárgyalja”存储为“Újratárgyalja”.
MysqL .Net连接器以这种方式下载它们.我尝试了很多与System.Text.Encoding.Convert()的组合,但没有一个工作.
发送集名称’utf8′(或其他字符集)无法解决它.
如何将它们从双UTF-8解码为UTF-8?
解决方法
# -*- coding: utf-8 -*- uni = u'Újratárgyalja' enc1 = uni.encode('utf-8') enc2 = enc1.decode('latin-1').encode('utf-8') dec3 = enc2.decode('utf-8') dec4 = dec3.encode('latin-1').decode('utf-8') for x in (uni,enc1,enc2,dec3,dec4): print repr(x),x
这是有趣的输出……:
u'\xdajrat\xe1rgyalja' Újratárgyalja '\xc3\x9ajrat\xc3\xa1rgyalja' Újratárgyalja '\xc3\x83\xc2\x9ajrat\xc3\x83\xc2\xa1rgyalja' Ãjratárgyalja u'\xc3\x9ajrat\xc3\xa1rgyalja' Ãjratárgyalja u'\xdajrat\xe1rgyalja' Újratárgyalja
以Ã开头的奇怪字符串显示为enc2,即两个utf-8编码,其中散布的latin-1解码投入到混合中.正如您所看到的那样,它可以通过完全相反的操作序列来解除:解码为utf-8,重新编码为latin-1,再次重新解码为utf-8 – 原始字符串又回来了(yay !).
我相信Latin-1(又名ISO-8859-1)和UTF-8的正常往返特性应该保证这个序列能够正常工作(抱歉,没有C#可以立即尝试使用该语言,但我会期望编码/解码序列不应该依赖于使用的特定编程语言.
Delphi 2007 x Windows 10 - 打开项目时出错 (Delphi 2007 x Windows 10 - Error on opening project)
问题:
Just updated from Windows 8.1 to Windows 10 and now when I try to open any project on Delphi 2007, I get his error :
Unable to load project xxxxx The imported project "c:\Windows\Microsft.NET...\Borland.Delphi.Targets" was not found. Confirm that the path declaration is correct, and that file exists on disk
查找需拷贝的文件路径:
在 C:\Windows.old 目录下搜索 Borland.Common.Targets 就能找到该文件所在路径。
解决方案:
You need to copy some files in your old Windows folder to the new one. After that projects open again.
The needed files are these :
c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Common.Targets c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Cpp.Targets c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Group.Targets
Delphi 2007在64Windows系统出现 delphi 2007 assertion failure thread32.cpp 的解决方法
总结
以上是小编为你收集整理的Delphi 2007在64Windows系统出现 delphi 2007 assertion failure thread32.cpp 的解决方法全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
关于使用Delphi 2007解码UTF-8编码的西里尔文的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于C ++ wcout unocode(西里尔文,日文)、c# – 如何将已经两次UTF-8编码的字符串解码为简单的UTF-8?、Delphi 2007 x Windows 10 - 打开项目时出错 (Delphi 2007 x Windows 10 - Error on opening project)、Delphi 2007在64Windows系统出现 delphi 2007 assertion failure thread32.cpp 的解决方法的相关信息,请在本站寻找。
本文标签: