I am struggling here to understand......
The default encoding.
See photo 1.
Why does this NOT work?
Code:
#!/bin/bash
# Code for OSX 10.13.5. default UNICODE encoding.
echo""
echo "The default UTF-8..."
locale
echo""
echo "Change to 8 bit ASCII only..."
LANG="en_GB.US-ASCII"
export LANG="en_GB.US-ASCII"
locale
echo ""
for N in {0..255}
do
printf '\x'$( printf "%02x" "$N" )
done
echo ""
Runtime result:
Code:
Last login: Mon Jun 25 17:35:20 on ttys000
AMIGA:amiga~> cd ~/Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> ./Unicode_Locale.sh
The default UTF-8...
LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL=
Change to 8 bit ASCII only...
LANG="en_GB.US-ASCII"
LC_COLLATE="en_GB.US-ASCII"
LC_CTYPE="en_GB.US-ASCII"
LC_MESSAGES="en_GB.US-ASCII"
LC_MONETARY="en_GB.US-ASCII"
LC_NUMERIC="en_GB.US-ASCII"
LC_TIME="en_GB.US-ASCII"
LC_ALL=
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
AMIGA:amiga~/Desktop/Code/Shell> _
Now change encoding from terminal preferences to Western ASCII.
See photo 2.
And voila it works.
Code:
#!/bin/bash
echo ""
echo "Default encoding changed to ~ASCII via terminal preferences..."
locale
echo""
for N in {0..255}
do
printf '\x'$( printf "%02x" "$N" )
done
echo ""
Runtime result:
Code:
Last login: Mon Jun 25 17:42:33 on ttys000
AMIGA:amiga~> cd ~/Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> ./ASCII_Coding.sh
Default encoding changed to ~ASCII via terminal preferences...
LANG="en_GB.US-ASCII"
LC_COLLATE="en_GB.US-ASCII"
LC_CTYPE="en_GB.US-ASCII"
LC_MESSAGES="en_GB.US-ASCII"
LC_MONETARY="en_GB.US-ASCII"
LC_NUMERIC="en_GB.US-ASCII"
LC_TIME="en_GB.US-ASCII"
LC_ALL=
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ**
AMIGA:amiga~/Desktop/Code/Shell> _
Am I missing something with the soft-coded locale change as opposed to the terminal startup one?
Hi ALL,
Is it possible to decode the core dumb file to find the error?
I get an Memory Core Dumb error with an core file.
Regards,
P. Prathaban. (3 Replies)
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)
Hi, wondering if anyone can suggest a tool to me that will let me either cut & paste hex or type it in for packet decoding.
I want to be able to decode a packet as done with tcpdump or wireshark, but I want to be able to manually input the hex myself. (2 Replies)
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)
The challenge:
Decode URL's, i.e. convert %HEX to the corresponding special characters, using only UNIX base utilities, and without having to type out each special character.
I have an anonymous C code snippet where the author assigns each hex digit a number from 0 to 16 and then does some... (2 Replies)
I am trying to understand a UNIX script which FTPs certain files from a remote location to the local machine. I understand the basic FTP command but the UNIX script uses the following command:
ftp -n -i -v > $logftp_trg 2>&1 <<!
open $MFX_FTP_SERVER
user $MFX_FTP_LOGIN $MFX_FTP_PWD
Can anyone... (5 Replies)
Hi, fellows
i am modifying asn1 schema to be able to decode a file, but i am hitting a error on one of the fields using free online tool asn1-playground. I suspect i need to change type and have tried with IDENTIFIER but it doesn't help...any ideas check the schema and file down , please
... (0 Replies)
Hi all!!
Im using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . Im expecting / looking an output as UTF8 or ANSI / ASCII
Is there command to display the files encoding?
Thank you! (2 Replies)