Terminanl removes characters that should not be deleted - terminal

I have a problem with terminal. When I use language different from English I can delete static characters.

The problem was in locale. I set it and now terminal works correct.

Related

Special character "à" not recognized in a path in Windows

EDIT : my original post was about PostgreSQL since I thought there lied the problem. But after the investigation allowed by the comments, it is not a PostgreSQL case, but a more general one related to the Windows' command prompt.
I am trying to use the COPY command to copy a selection in a CSV file in PostgreSQL. For some reason, it is not working. At first I thought it was because of the blank spaces in the names of the folders, but it worked fine when I tested it in another case. Then I thought about the length of the path, but it seems I am far from the size limit.
After further testings, it seems the problem is more related to the fact that my path contains a french special character "à", which is not recognized in the command prompt.
Here is the path :
'\\10.000.000.00\data\SIEA\_0 Mise à niveau des boites\Zone NRA de Ferney\Ornex 04-05\APD_e\06_Fichier Adresse - IPE\ZAPM_01281_00004_ADDR_ETR.csv'
I tried to replace the character by some others, according to what I found online, but without success, possibly because I didn't find the proper character.
Does anyone have a clue on how to solve this ?
Thanks

Codemirror (AjaXplorer/Linux Webserver): ANSI-files with special characters

I have a AjaXplorer installation on a Linux Webserver.
One of the plugins of AjaXplorer is Codemirror - to view and edit text files.
Now I have the following situation: If I create a txt-File on Windows (ANSI) and upload it into Ajaxplorer (UTF-8), Codemirror shows every special character as a question mark. Consequently the whole file will be saved with question marks instead of the special characters.
But if a file once is saved in UTF-8, the special characters will be saved correctly.
So the problem exists in opening the ANSI-File. This is the point where I have to implement the solution, for example convert ANSI to UTF-8.
The 'funny' thing is, that if I open a fresh uploaded ANSI-File and a saved UTF-8 file with VIM on the Linux console, they look exactly the same, but the output in codemirror is different.
This is a uploaded ANSI-File with special characters like ä and ö and ü
Output in Codemirror: 'like ? and ? and ?'
This is a saved UTF8-File with special characters like ä and ö and ü
Output in Codemirror 'like ä and ö and ü'
This is the CodeMirror-Class of AjaXplorer and I think here must be the point where I could intervene:
https://github.com/mattleff/AjaXplorer/blob/master/plugins/editor.codemirror/class.CodeMirrorEditor.js
As you may see, I'm not a pro and I already tried some code pieces - otherwise I already had the solution ;-) I would be happy if someone gives me a hint! Thank you!!!

Does Windows console supports ANSI?

Does the Windows console supporsts ANSI control characters?
It doesn't support many ANSI control characters by default (which is also mentioned in the wikipedia article http://en.wikipedia.org/wiki/ANSI_escape_code), but there are ways to make that possible.
Look into the answers to this question: How to load ANSI escape codes or get coloured file listing in WinXP cmd shell?
You might happen upon something useful.
I assume you're referring to ASCII control characters.
The answer is "some". You can read backspace keypresses, for example, and you can pipe-in things like the ASCII "Bell" character.
However if you mean that the Windows console automatically resolves escaped characters, such as converting "\b" into "Bell", then no, you have to do that yourself.
Note that I speak about entering keypresses directly into the console and not batch files, for that see #ProblemFactory's answer.

.mo file in utf-8 encoding dont work with accentuated words in a linux server

I was translating the website and all was working fine but when I put the files in the online server (linux), the translation worked but the accented letters in spanish appear like this �
somebody knows how I can fix it?
If you are using PHP, you probably need to add the bind_textdomain_codeset function to tell the system that your mo file is returning UTF-8 (or whatever you have specified in the PO file). So something like this should of the trick:
$language = 'de_DE';
bindtextdomain($language, APP_ROOT.'locale'); // Define domain
textdomain($language); // Choose domain, translation is looking for in locale/de_DE/LC_MESSAGES/de_DE.mo now
bind_textdomain_codeset($language, 'UTF-8'); // Tell the system out MO files will return UTF8
Appeared like � where? If it's in the web page, you need to make sure the translation is in the same character set as the rest of the HTML and that that character set is properly noted on top.
It seems me to have the same problem. Can't resolve the � symbols.
I have the charset correctly setted in the top of my html (utf-8), and the .po file is also in utf-8. I tried the bind_textdomain_codeset command but didn't work.
Server is linux.
[ RESOLVED ]
Adding this line:
bind_textdomain_codeset("default", "utf-8");
note default instead of language domain. Wonder why..

Is there anyway for a bash (or any other shell) script to detect whether the current terminal supports unicode characters?

I'd like to use Unicode characters if they are supported by the terminal, and fall back to ASCII characters if the user's terminal can't display them correctly. Is there any relatively easy way to do this in a shell script?
First, you're probably confusing Unicode with a particular encoding. Suppose you know that the termnal supports Unicode characters -- you still don't know how to print them!
You're probably thinking about something like UTF-8, the most popular Unicode encoding out there.
To get the encoding of the current locale, use
locale charmap
This is the encoding of the current locale, and theoretically it may differ from the encoding used by the terminal, but in that case something is broken on user's side.
In script print
:set encoding=utf-8
If you want your terminal support unicode, become new terminal with -u8 option
type in terminal xterm -u8

Resources