Unix and Unicode


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unix and Unicode
# 1  
Old 07-04-2006
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); however, I thought I'd ask a questions that's even more bare:

How would I create (touch) a file that is named in UTF-8? For example, the terminal would display: groß

Thanks much--I've been banging my head against this.

P.S. I'm using RedHat Linux and locale tells me I'm en_US.UTF-8.
# 2  
Old 07-04-2006
The attached screenshot shows how I made it. I think it depends on the shell being used. I used bash and touched the file without problems. As bash is default on Linux, it is likely to work for you too.

Ask again if you have further queries.

N.B. This snapshot is taken on Fedora Core 5.
Unix and Unicode-utf8termpng
# 3  
Old 07-04-2006
Excellent! Thank you. What do you call the $' ' syntax?

Perhaps you could help me with another question.... I have a file on my Windows 98 desktop called "frere_jacques.mp3". I opened charmap, copied the "é", and renamed the file to "frére_jacques.mp3". When I copy the file onto my Unix box via Samba, an ls shows "fr?re_jacques.mp3" and od -cx shows:

Code:
0000000   f   r 202   r   e   _   j   a   c   q   u   e   s   .   m   p
        7266 7282 5f65 616a 7163 6575 2e73 706d
0000020   3  \n
        0a33
0000022

I don't understand this result.

Samba (3.0.22) is configured with:

unix charset = UTF8
display charset = UTF8
dos charset = (I've tried ASCII and UTF8)

By the way, the groß file that I created shows as "gro_(black bar)" through Samba. Something is awry...

Thanks again.
# 4  
Old 07-04-2006
Quite obviously is not creating the file in Unicode. I am not familiar with Samba Unicode handling but from your quoted results it appears that it has converted the filename into ISO-8859-1 instead.

From your "od", é has the (Extended) ASCII charcode of 82 (in hex), which matches the output of "od" that you quoted. Therefore, your "od" has shown an ASCII representation. How did you generate the 'od'? Piping ls output to od? Also in UTF-8, that character should be represented by 2 bytes, not 1.

I also tried on my system (both machines Linux and samba-mountable), and I could touch the groß file and have the name properly shown on both systems. The smb.conf has no special Unicode-related configuration. Is it possible that your Windows side has problems with configuration or support?

If all else fails, you may need to visit Samba-related newsgroups or other user communities for help.
# 5  
Old 07-06-2006
Bernard,

As usual, it was something silly on my part. I had installed a newer version of Samba, but certain links and rc.d scripts were still pointing to the old. This is working great Smilie

Thank you!
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

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 (7 Replies)
Discussion started by: tip78
7 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. 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

5. 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

6. 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

7. UNIX for Advanced & Expert Users

Unicode Support in BIND?

Here at the agency I work for, a need has arisen for a subdomain that utilizes some unicode characters. It has something to do with our foreign clients getting "page could not be displayed" errors in their internationalized browsers. I am still investigating the issue, but I've been asked to find... (2 Replies)
Discussion started by: deckard
2 Replies

8. 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

9. 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

10. Shell Programming and Scripting

converting string to unicode

How can I can convert a string in a shell script that looks something like: ]] to unicode equivalent? thanks a lot, webtekie (1 Reply)
Discussion started by: webtekie
1 Replies
Login or Register to Ask a Question