The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
0answers
10 views

Get consistent encoding for all files in directory

I have a directory containing lots of csv files from various vendors with two different encodings: ASCII Text / UTF-8 UCS2 / UTF-16 little endian I'd like to use grep, awk, sed and other utilities ...
3
votes
3answers
184 views

Convert UTF-8 code represented in terms of ASCII to UTF-8

I have a text file which is an ASCII file itself, but represents the code of utf-8: \350\207\252\345\212\250\346\216 Is there some program or command that can convert this ASCII file to a text ...
0
votes
0answers
19 views

Nothing helps Gnome Terminal to not default to ANSI_x3.4-1968

I would really like gnome-terminal to default to a UTF-8 encoding, but whatever I do, I can't get it to do it. I don't have sudo access, so I cannot edit /etc/environment. I'm on a university-managed ...
1
vote
3answers
67 views

Why are file names surrounded wtih “â” sign?

After adding alias rm='rm -i' to my ~/.bashrc file, because when I remove file, shell wasn't asking for confirmation, file names are surrounded with "â" sign like in example below: rm: cannot remove ...
-1
votes
1answer
22 views

Usefulness of --from-code in command iconv

Is the --from-code option of the iconv command useful (http://man7.org/linux/man-pages/man3/iconv.3.html)? I mean, I don't see any difference if I specify this parameter (--from-code 'iso-8859-1' or ...
4
votes
1answer
39 views

Gedit displays text, but cat tells a different story

I am trying to sort a dictionary from Grady Ward's Moby and have encountered a bit of a problem. When I open it in gedit, I get: abaca×N abaciscus×N abacist×N aback×v abacli×p Abaco×N abactinal×A ...
1
vote
0answers
14 views

Understanding script and font relation (character-map)

When I use charactermap, I found that if I change font, only Latin script changes. Character by all other scripts sounds independent with change in font! So, I want to know what is relationship ...
1
vote
1answer
28 views

How to format password using SCP

I'm currently writing a Script to upload files to my server via SCP. I have the following line: sshpass -p password!% scp -P 1234 ./test.text user@mydyndns:~/test.txt But everytime I try that I ...
0
votes
0answers
17 views

Searching text data in Hebrew, Arabic or Aramaic

How can I search for a (sub-)string in a database that has several languages, including Hebrew? I am assuming that the text being right-to-left is a question of the presentation, but the logical ...
1
vote
1answer
32 views

Can not get the file names with convmv

I have just uploaded some files on a FreeBSD server. Some files have the ??? into their names. The files came from a windows machine, so I try this: $ convmv -f cp850 -t utf-8 * Starting a dry run ...
2
votes
1answer
24 views

Cyrillic file names broken after upgrading Slackware

After upgrading glibc and some other libraries on Slackware instead of cyrillic names I see the garbage: | Was before | Is now | |------------+------------------| | Вождение | ...
2
votes
1answer
85 views

Convert TeX accents to UTF-8 in Python

edit below First of all, I am quite sure this is a duplicated question. But I have no idea how to search for it. I spent quite a long time already. I am reading with python from a .txt file the path ...
0
votes
1answer
89 views

LMDE2 / MATE locale charset inconsistency

I have a machine with Linux Mint Debian Edition 2 "Betsy" (installed as RC, with all available updates applied) and MATE desktop environment. My problem is that in some applications special characters ...
0
votes
1answer
45 views

make `tar` archive from NTFS with non-ascii file names

Loaded a live disk into a Windows based machine with NTFS files. Being a Linux user for some years, using tar came to my mind instantly and made some backup archives from partitions and stored them ...
4
votes
4answers
257 views

Make tail not modify the charset of the terminal

In a linux terminal (CentOS) I am using the command tail --follow=name my-rolling-file.log in order to see the logs of my application. Sometimes in the log there is some binary data dumped (I dump ...
0
votes
1answer
37 views

Error not found [closed]

I wrote this script to encode / encrypt data from a sql query by changing the names of tables and fields (I played on the ASCII character codes). #! /bin/bash chr() { [ "$1" -lt 256 ] || return 1 ...
28
votes
2answers
847 views

find(1): how is the star wildcard implemented for it to fail on some filenames?

In a file system where filenames are in UTF-8, I have a file with a faulty name; it is displayed as: D�sinstaller, actual name according to zsh: D$'\351'sinstaller, Latin1 for Désinstaller, itself a ...
0
votes
1answer
80 views

iconv can't convert circled digits to/from Japanese encodings

The unicode range of circled digits (U+2460 .. U+2468) cannot be converted to, or from, any of the Japanese encodings (EUC-JP, Shift-JIS, ISO-2022-JP), even though they exist there, and I run across ...
0
votes
2answers
185 views

Check whether text contains non-ASCII characters in a shell script

I have a file, I want to determine if it contains only English ASCII characters. I thought this is a very common question, but when I googled it, there is no direct answer or related. According to ...
1
vote
1answer
123 views

cp: cannot stat error - when filename has Asian characters

I am simply trying to copy files using cp -r /home/user/source/ /home/user/destination/ but it throws me the cp: cannot stat /source/filename.xxx error for some of the files. When I searched for this ...
1
vote
4answers
204 views

How to recognize which ASCII character in hex is this?

We have a textfile that we want to clear from "bad" characters. If we open it with vim (with ":set number"): 57000044 zo¥<9a>¥ge¥o¥graph¥i¥cal¥ly 39999999 pariá¹<83>Å<9b>a The ...
1
vote
2answers
51 views

How to only leave in given characters in a file?

Purpose: tr -cd '\12\40-\176' but with accents, ex.: á, í, ű, ő, ö, ü, ű, ú, ó, é. In octal: "á" is 341 "\n" is 12 So I tried: [user@notebook ~]$ printf 'XXXá\nXXX' | tr -cd '\12\341' | ...
1
vote
1answer
52 views

Any way to interpret pstree?

-bash-3.2$ pstree 29838 RBcron.shâââjavaâââ15*[{java}] -bash-3.2$ pstree 24423 bashââ¬âRBcron.shâââjavaâââ15*[{java}] ââvim -bash-3.2$ Any way to interpret this? Why would this happen?
2
votes
1answer
130 views

Question marks instead of national letters in console

I have Netgear Stora MS2000 (which uses a modified version of Red Hat) and have strange font issues while connecting by SSH. Note that this occurs both when connecting by PuTTY from Windows and by ...
1
vote
1answer
62 views

How do I edit text in Cyrillic / Russian on OpenBSD?

I'm trying to make it possible to easily edit text in Cyrillic / Russian on a remote OpenBSD 5.2 amd64. I'm using emacs-21.4p18-no_x11, which doesn't show any Cyrillic characters whatsoever when I ...
1
vote
2answers
710 views

How to convert unknown-8bit file to utf8

I have a .srt file that displays as gibberish when I open it in gEdit in ubuntu. So I want to convert it to utf8 to be able to read it. When I try to figure out what the encoding it give: file -i ...
1
vote
0answers
96 views

Rename files with non-utf8 characters using detox

I am trying to use detox in the following way detox -s utf_8-only -r -v -n to detect invalid filenames on my system. The command performs mostly ok. Unfortunately it falsely detects also German ...
4
votes
2answers
169 views

Characters visible in vi, but not in cat.

I have a 300 lines file with ^@ character between each characters in the file. (I cannot post the entire contents for security reasons, so I am pasting only the first line) [mercury@app01 ftp_logs]$ ...
19
votes
5answers
2k views

Generating a random password; why isn't this portable?

I want to generate a random password, and am doing it like so: </dev/urandom tr -dc [:print:] | head -c 64 On my laptop, which runs Ubuntu, this produces only printable characters, as intended. ...
1
vote
1answer
146 views

Special characters in a web feed

I am running a script to check my gmail from the command line and display the first 35 characters in the title. curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | \ grep ...
1
vote
1answer
161 views

script to parse integer and convert it to char code

I am noob on Unix. I've a very unique problem where and really appreciate your help. I need to parse string containing hash code value and convert the hash code is equivalent char representation. Here ...
0
votes
2answers
68 views

Find out which encoding method less uses to display the content of a text file?

There is a plain text file, which Emacs can't display correctly, but less can. I wonder if less automatically detects the encoding method for each individual text file, or just use a single default ...
3
votes
1answer
240 views

How do I view cp1251 text file in UTF-8 console?

Attempt 1: $ less subs.srt "subs.srt" may be a binary file. See it anyway? <C8><F2><E0><EB><FC><FF><ED> ... Attempt 2: $ LANG=ru_RU.CP1251 less subs.srt ...
1
vote
0answers
74 views

How do I configure medit to display UTF-8?

My environment is set to use UTF-8. I produce a file in UTF-8 encoding. It works correctly on the terminal. For example: $ echo ééé > test $ cat test $ echo é | od -t x1 0000000 c3 a9 0a ...
1
vote
1answer
163 views

iconv terminated by signal 7

I was running a little bash script on some text files: find . -name "*.dat" -exec iconv --from-code='UTF-8' --to-code='ASCII//TRANSLIT' {} --output={} \; My machine is a Ubuntu 14.04 LTS. After a ...
2
votes
0answers
98 views

iconv cannot replace Ø

It appears that iconv cannot, for example, replace the letter Ø. It was also noted in the second answer to http://stackoverflow.com/questions/3371697/replacing-accented-characters-php I have two ...
3
votes
2answers
99 views

Why can't I grep this command line option?

The output of man icc contains -Ldir Tells the linker to search for libraries... Doing man icc | grep "\-L" gives back the "-Ldir" line while man icc | grep "\-Ldir" does not. What am ...
3
votes
2answers
268 views

Check files for conventions

I need a script that checks and lists all text files for project conventions. With conventions I mean for example: UTF-8 encoding No trailing white spaces Newline at the end of file No not-ascii ...
1
vote
1answer
419 views

Converting a UTF-8 file to ASCII (best-effort)

I have a file in UTF-8 that contains texts in multiple languages. A lot of it are people's names. I need to convert it to ASCII and I need the result to look as decent as possible. There are many ...
2
votes
1answer
301 views

$Unix character set conversion

I'm confused by character-sets in Unix. I have a CSV file downloaded via SFTP: $ file -ib myfile text/plain; charset=us-ascii The purpose for this character-set quest is that the data within file ...
2
votes
1answer
77 views

Change Text File Encoding without knowning the source encoding

I want to change the charset encoding for a file in unix with a single command but since this will be an automated process it's impossible for me to know the source encoding. So I want a command that ...
0
votes
0answers
55 views

jumbled character set

In my Linux env, for some unknown! reason when I process a raw unformatted file which I copied from Win7prof (was encoded in utf-16), the resulting file is all jumbled. It will print OK in Linux ...
5
votes
1answer
190 views

Some apps doesn't accept some characters from the «Compose» key

The problem is that the compose key works fine, but some application doesn't accept some characters from it. E.g. I can paste the character ∞ in Emacs (Compose+8+8), but this won't work in FireFox, ...
1
vote
1answer
117 views

File weird character encoding [closed]

I'm on ubuntu 13.10 and am writing a program in eclipse that's supposed to output my result in a file. I'm building an LZW compression and decompression program that uses character conversion to its ...
1
vote
0answers
92 views

Why doesn't this sed substitution for a non-ASCII byte work?

I tried this substitution with GNU sed on OS X (4.2.2 installed through Homebrew). But it doesn't work. printf "Hello\x92 World" | gsed -r "s/[\x92]/'/g" The expected output is: Hello' World The ...
0
votes
0answers
22 views

Change encoding of a text file in-place: iconv alternative? [duplicate]

Apparently, iconv is unable to use the same file as input and output file. Other tools, e.g. sed, have an -i switch that allows "updating" a file in-place. (Under the hood, temporary files are ...
5
votes
1answer
309 views

Can not use `cut -c` (`--characters`) with UTF-8?

The command cut has an option -c to work on characters, instead of bytes with the option -b. But that does not seem to work, in en_US.UTF-8 locale: The second byte gives the second ASCII character ...
3
votes
1answer
221 views

How to remove Russian and Arabic strings from a text file

Problem: I have text file with approximately 1M lines, each line consists of multiple words Some lines contain Russian or Arabic words (lets call them "bad lines"), I want to remove only these bad ...
0
votes
2answers
160 views

Can CentOS be set to pure EBCDIC?

I need to directly manipulate files from a mainframe. Text would be encoded in EBCDIC. Data can contain binary and packed decimal fields. I know I can deal with the data. I am trying to avoid the ...
0
votes
0answers
203 views

A quick and dirty way of finding invalid characters in a text file by gedit

In vonbrand's comment to How do I scan for invalid characters on gedit? A quick and dirty way would be to edit the file (probably adding and deleting something will be enough to make gedit ...