Sponsored Content
Full Discussion: How to know file encoding?
Top Forums Shell Programming and Scripting How to know file encoding? Post 303038014 by tricampeon81 on Wednesday 21st of August 2019 11:05:00 AM
Old 08-21-2019
excellent function

Now how can I change it from ASCII to UTF-8 and vice versa?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File encoding in Unix

1. I have a shell script which creates a file using cat command. How can i find what encoding the file follows (e.g. UTF8, ANSI)? 2. I want to convert that file to PC-ANSI format. How can i achieve that? I am using HP-Unix. (6 Replies)
Discussion started by: ssmallya
6 Replies

2. Shell Programming and Scripting

Delete original wav file if lame was successful encoding.

In a bash script: src=”cooltrack.wav” dst=”cooltrack.mp3” lame $src $dst I would like to add some line that would delete the source wav file like: rm $src but I would like this only if the encoding was successful. What should I include before deleting the original to check that the... (2 Replies)
Discussion started by: Aia
2 Replies

3. Shell Programming and Scripting

get the file encoding

Hello! The system is AIX 5.3 Give please command or script to get the file encoding Thanks (2 Replies)
Discussion started by: vinment
2 Replies

4. AIX

get the file encoding

Hello! The system is AIX 5.3 Give please command or script to get the file encoding (1 Reply)
Discussion started by: vinment
1 Replies

5. Shell Programming and Scripting

Cygwin vi XML file encoding problem

Hi, I have got a zip (binary) file transferred from MacOS (thus it has additional __MACOSX directory packed inside). On extracting this zip, there are few *.xml files available. When I opened this *.xml file in vim editor using Cygwin (on windows) the editor displayed in the bottom. I tried... (4 Replies)
Discussion started by: royalibrahim
4 Replies

6. HP-UX

how to find the character encoding of a file in hp_ux

how to find the character encoding of a file in hp_ux (1 Reply)
Discussion started by: alokjyotibal
1 Replies

7. Shell Programming and Scripting

How to find the file encoding and updating the file encoding?

Hi, I am beginner to Unix. My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8. Please advice me how to proceed on this. (7 Replies)
Discussion started by: cnraja
7 Replies

8. UNIX for Dummies Questions & Answers

Determing the encoding of a file

Hi, I am trying to determine the encoding for the file, because to convert to UTF-8, it seems as though I have to know the encoding of the source. Tried this file <filename> give me this: <filename>:data or International Language text Tried to see the locale and this is the output:... (6 Replies)
Discussion started by: MIA651
6 Replies

9. UNIX for Advanced & Expert Users

ISO 88591 file encoding charset in Linux

Hello Experts, please help to provide any insight as I am facing issue migrating java application from hpux to redhat. The java program is using InputStreamReader to read a file without specifying any charset parameter. However, in new Linux Redhat 5.6 environent, when reading a file that... (1 Reply)
Discussion started by: sonic_air
1 Replies

10. Solaris

View file encoding then change encoding.

Hi all!! I´m using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . I´m expecting / looking an output as UTF8 or ANSI / ASCII Is there command to display the files encoding? Thank you! (2 Replies)
Discussion started by: mrreds
2 Replies
libcaca character set conversions(3caca)			      libcaca				  libcaca character set conversions(3caca)

NAME
libcaca character set conversions - Functions __extern uint32_t caca_utf8_to_utf32 (char const *, size_t *) Convert a UTF-8 character to UTF-32. __extern size_t caca_utf32_to_utf8 (char *, uint32_t) Convert a UTF-32 character to UTF-8. __extern uint8_t caca_utf32_to_cp437 (uint32_t) Convert a UTF-32 character to CP437. __extern uint32_t caca_cp437_to_utf32 (uint8_t) Convert a CP437 character to UTF-32. __extern char caca_utf32_to_ascii (uint32_t) Convert a UTF-32 character to ASCII. __extern int caca_utf32_is_fullwidth (uint32_t) Tell whether a UTF-32 character is fullwidth. Detailed Description These functions perform conversions between usual character sets. Function Documentation __extern uint32_t caca_utf8_to_utf32 (char const *s, size_t *bytes) Convert a UTF-8 character read from a string and return its value in the UTF-32 character set. If the second argument is not null, the total number of read bytes is written in it. If a null byte was reached before the expected end of the UTF-8 sequence, this function returns zero and the number of read bytes is set to zero. This function never fails, but its behaviour with illegal UTF-8 sequences is undefined. Parameters: s A string containing the UTF-8 character. bytes A pointer to a size_t to store the number of bytes in the character, or NULL. Returns: The corresponding UTF-32 character, or zero if the character is incomplete. Referenced by caca_put_str(). __extern size_t caca_utf32_to_utf8 (char *buf, uint32_tch) Convert a UTF-32 character read from a string and write its value in the UTF-8 character set into the given buffer. This function never fails, but its behaviour with illegal UTF-32 characters is undefined. Parameters: buf A pointer to a character buffer where the UTF-8 sequence will be written. ch The UTF-32 character. Returns: The number of bytes written. __extern uint8_t caca_utf32_to_cp437 (uint32_tch) Convert a UTF-32 character read from a string and return its value in the CP437 character set, or '?' if the character has no equivalent. This function never fails. Parameters: ch The UTF-32 character. Returns: The corresponding CP437 character, or '?' if not representable. __extern uint32_t caca_cp437_to_utf32 (uint8_tch) Convert a CP437 character read from a string and return its value in the UTF-32 character set, or zero if the character is a CP437 control character. This function never fails. Parameters: ch The CP437 character. Returns: The corresponding UTF-32 character, or zero if not representable. __extern char caca_utf32_to_ascii (uint32_tch) Convert a UTF-32 character into an ASCII character. When no equivalent exists, a graphically close equivalent is sought. This function never fails, but its behaviour with illegal UTF-32 characters is undefined. Parameters: ch The UTF-32 character. Returns: The corresponding ASCII character, or a graphically close equivalent if found, or '?' if not representable. __extern int caca_utf32_is_fullwidth (uint32_tch) Check whether the given UTF-32 character should be printed at twice the normal width (fullwidth characters). If the character is unknown or if its status cannot be decided, it is treated as a standard-width character. This function never fails. Parameters: ch The UTF-32 character. Returns: 1 if the character is fullwidth, 0 otherwise. Referenced by caca_put_char(), and caca_put_str(). Author Generated automatically by Doxygen for libcaca from the source code. Version 0.99.beta18 Fri Apr 6 2012 libcaca character set conversions(3caca)
All times are GMT -4. The time now is 10:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy