转换,反之亦然 [英] Conversion and vice versa

查看:139
本文介绍了转换,反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I need to convert ascii characters to hex and the hex to ascii characters.

Example:-- तेस्त+' ' to hex value %924%947%938%94D%924%20(0924 0947 0938 094D 09240020)
and hex value %924%947%938%94D%924%20(0924 0947 0938 094D 09240020) to तेस्त

Can any body help me either in ASP classic or JavaScript?

推荐答案

问题是完全荒谬。您不能将梵文转换为十六进制,而将十六进制转换为梵文只是因为梵文不编码,而十六进制不是编码。出于同样的原因,你不能将其中任何一个转换为else的Unicode。它们不是文件格式的任何数据,或类似的东西。



此外,即使Unicode不是编码,但不同的Unicode UTF。换句话说,在Unicode中编写一些字符的方法不止一种;但所有的方法都是等价的。



不是说这是可能的,或者不是,整个想法没有意义。



首先,您需要学习一些非常非常基本的计算概念。我甚至不清楚你错过了什么,但是非常基本的东西。然后你需要了解Unicode是什么。请阅读相关主题。这可能非常困难,因为我害怕你不明白什么是文本,二进制等等。也许,hex你的意思是文本表示,其中每个代码点表示为一个单词一些十六进制数字,即字符。但是,正如我所说,这取决于UTF是什么。你应该明白你想要什么,为什么,然后提出一个正确的问题。



顺便说一下,我认为在某些地方转换Unicode文本绝对没有实际的理由UTF(最好是UTF-8)到其他任何东西。但是,如果你这样做是为了学习 - 我的尊重。在这种情况下,您将看到实验的结果。



-SA
The question is the total absurd. You cannot "convert" Devanagari to "hex", and "hex" to Devanagari simply because Devanagari is not encoding, and "hex" is not encoding. By the same reason, you cannot "convert" either of that to Unicode of else. They are not any data of file formats, or something like that.

Moreover, even Unicode is not encoding, but different Unicode UTFs are. In other words, there is more than one way to write some characters in Unicode; but all of the ways are equivalent.

Not that this is possible or, not, the whole idea makes no sense.

First, you need to learn some very, very basic notions of computing. I don''t even clearly understand what do you miss, but something very basic. Then you need to learn what Unicode is. Just read on the topic. And this can be very difficult, because I''m afraid you don''t understand what is "text", "binary", etc. Probably, by "hex" you mean text presentation where each code point is expressed as a word of a number of hexadecimal digits, that is, characters. But, as I say, it depends on what UTF is this. You should understand what you want and why, and then ask a correct question.

And, by the way, I see absolutely no practical reason of transcoding Unicode text in some UTF (better be UTF-8) into anything else. However, if you do it for the purpose of learning — my respect. In this case, you will see everything as a result of your experiments.

—SA


这篇关于转换,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆