Help with \u0401 codes ? unicode or something


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with \u0401 codes ? unicode or something
# 1  
Old 10-08-2010
Help with \u0401 codes ? unicode or something

hello
there's some stranges code symbols they looks like this:
\u0438 \u0247. unicode i think
this code can be viewed by javascript so i need it
i need to convert casual characters to this code with perl
atm stucked with ord, chr, pack, etc things but they giving other digits
tip78
# 2  
Old 10-08-2010
Looks like CYRILLIC SMALL LETTER I (i.e the reversed small N) and LATIN SMALL LETTER E WITH STROKE (i.e small e with a forward stroke though it) but my betting is that the are something else as far as your application is concerned.

Can you provide an example of the "casual characters" you need to convert?
# 3  
Old 10-09-2010
yes cyrillic but latin too
here's example:
<table><tr><td>маленький пример</td></tr></table>

i need to encode this line to line of characters: \u0203\u0472 etc (i don't actualy know the right code for those characters)
tip78
# 4  
Old 10-09-2010
I don't know if this will be of use to you - it's a website with character lookup tables.

Free Online Unicode Character Map

HTH, Rob.

(I've never done any unicode translation myself, but found this with a web search "unicode lookup".)
# 5  
Old 10-09-2010
well those codes looks similar to what i need but anyway i need to get them from casual characters through perl
perl somehow can convert it but i can't find how Smilie

---------- Post updated at 12:27 PM ---------- Previous update was at 10:40 AM ----------

found such function on javascript with whole charmap:

Code:
function koi2unicode(str) {
   var charmap   = unescape(
"\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590"+
"\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\u00A0\u2321\u00B0\u00B2\u00B7\u00F7"+
"\u2550\u2551\u2552\u0451\u2553\u2554\u2555\u2556\u2557\u2558\u2559\u255A\u255B\u255C\u255D\u255E"+
"\u255F\u2560\u2561\u0401\u2562\u2563\u2564\u2565\u2566\u2567\u2568\u2569\u256A\u256B\u256C\u00A9"+
"\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E"+
"\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A"+
"\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E"+
"\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A")
var code2char = function(code) {
               if(code >= 0x80 && code <= 0xFF) return charmap.charAt(code - 0x80)
               return String.fromCharCode(code)
            }
   var res = ""
   for(var i = 0; i < str.length; i++) res = res + code2char(str.charCodeAt(i))
   return res
}

but i still need it on perl :\

---------- Post updated at 01:51 PM ---------- Previous update was at 12:27 PM ----------

EXAMPLE
unpack("U",u046F) gives 117
117 is the code of character "u" (chr(117) = u, ord(u) = 117)

so HOW to get u046F back from 117 ???

pack("U",117) gives "u" but not hes code
hex(117) gives 279..

Last edited by tip78; 10-09-2010 at 06:57 AM.. Reason: Code tags, please...
tip78
# 6  
Old 10-09-2010
Have you looked at Text::Iconv?
# 7  
Old 10-09-2010
why? i don't need to convert text to other encoding
i need characters code from every symbol in that text

anyway i've done that with regexp and "hard replacement"
just every cyrillic symbol s/// to \u0char
tip78
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unicode help

is there any way to handle unicode such as ʃʰɐm̆ (1 Reply)
Discussion started by: sreejithalokkan
1 Replies

2. Shell Programming and Scripting

Unicode file validation

I don't want HTML_CONTENT,RICH_CONTENT,TEXT_CONTENT columns data in the file and reset of data we need to extract. Find the attached file. Need to extract date in between DI_UX_ROW_END tag. Can help me using unix command using AWK. Thanks, (2 Replies)
Discussion started by: bmk
2 Replies

3. Programming

Unicode filenames in C++?

I'm trying to figure out how to support Unicode or atleast an unsigned char in the d_name of struct dirent The problem i'm facing is that I'm checking file names for special characters and obviously the "char d_name" doesn't like it. I'm looping through the directory and getting the file... (3 Replies)
Discussion started by: james2432
3 Replies

4. UNIX for Advanced & Expert Users

mail with Unicode support

Hello, I have a question. There is a command line mail client "mail", it is good, but obviously, does not support Unicode. Are there any (other) mail clients for command line having support for Unicode (UTF-8) and maybe other encodings? Or are there any other versions of mail/mailx programm which... (0 Replies)
Discussion started by: Action
0 Replies

5. Programming

Unicode programing in C

im starting to go a little serious with c, woking in a personal project that will read a xml, which might contain Unicode characters (i know it will on my system, which is set to es_AR.UTF-8) im using mxml, and the documentation says it uses utf8 internally (no worries here). so i need to be... (4 Replies)
Discussion started by: broli
4 Replies

6. Programming

unicode problem

on some distributions UTF-32 is the default and i need to change the size of wchar_t to 2 bytes. i tried to compile it with -fwide-exec-charset=UTF-16 but it didn't help. anyone have any ideas? thanks, Akos (3 Replies)
Discussion started by: Akimaki
3 Replies

7. Programming

Concerned about C and UNICODE

Dear experts, While developping a C UNICODE application under AIX 5.3, I encountered the following problem, and after days of investigations I still could not find any solution. Please note that the application is full wchar_t based (not utf8) and that I could compile and run it without any... (4 Replies)
Discussion started by: tgilbert
4 Replies

8. UNIX for Advanced & Expert Users

Unix and Unicode

All, I'm trying to grasp how to use Unicode with/in Unix. I've made progress on some fronts, for example, when uploading files to my server I can use the intermediary language to convert the file to UTF-8. I'm having trouble getting Samba to do this (I'm using "unix charset" in smb.conf);... (4 Replies)
Discussion started by: effigy
4 Replies

9. Programming

How to display unicode characters / unicode string

I have a stream of characters like "\u8BBE\u5907\u7BA1" and i want to display it. I tried following things already without any luck. 1) printf("%s",L("\u8BBE\u5907\u7BA1")); 2) printf("%lc",0x8BBE); 3) setlocale followed by fwide followed by wprintf 4) also changed the local manually... (3 Replies)
Discussion started by: jackdorso
3 Replies

10. UNIX for Advanced & Expert Users

unicode

Hi, I have some software I need to install on HP-UX 11iv1 64bit but it must not be set up in unicode mode. I know unicode/ ASCII etc. I don't know how to get unix to switch between these. Is there an environment setting for that? I use the Korn shell. Thanks. (2 Replies)
Discussion started by: rein
2 Replies
Login or Register to Ask a Question