Page 1 of 2

SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 4:46 pm
by BorisAU
Symbols of the Russian language is not displayed properly and may not be processed in a bash script.
Can I add location UTF-8 ??

For example on the supplied Samsung emulator 2014 5.1 VirtualBox have the following locale

Code: Select all

root@smarttvemulator:~# echo $LANG
en_US.UTF-8
root@smarttvemulator:~# locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX
And in it with characters displaying all right.
In SamyGo these teams do not give out.

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 5:09 pm
by sectroyer
Yeah TV doesn't support locales, to much to change :)

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 5:22 pm
by zoelechat
BorisAU wrote:may not be processed in a bash script.
UTF-8 is fully supported in scripts :)

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 5:41 pm
by BorisAU
zoelechat wrote:
BorisAU wrote:may not be processed in a bash script.
UTF-8 is fully supported in scripts :)
Unfortunately no

Trivial File sorting script eventually turns all the characters of the Russian alphabet in the underscore _

Code: Select all

#!/bin/bash

VIDEO="/dtv/usb/sda5/temp/video"
MUSIC="/dtv/usb/sda5/temp/music"

# ?????????, ?????????? ?? ????????. ???? ??? - ??????? ??
if [ ! -e $VIDEO ]
then
  mkdir -p $VIDEO
fi

if [ ! -e $MUSIC ]
then
  mkdir -p $MUSIC
fi

for file in *
do                      
  if [ -f "$file" ] # ???? ???? "??????????" (?? ?????????? ? ?? ????-??????????)  ??????
  then
    case "$file" in
      *.avi|*.flv|*.wmv|*.vob)
        mv "$file" $VIDEO
        ;;
      *.mp3)
        mv "$file" $MUSIC
        ;;
    esac
  fi
done
file in

Code: Select all

?????.avi
file out

Code: Select all

_____.avi

Code: Select all

VDLinux#> ls
new file.mp3     ???? ??????.mp3

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 5:47 pm
by sectroyer
yes, expected, no sorting. Supported:
- printing to screen
That's all :) Else "blocked" by TV :)

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 6:01 pm
by BorisAU
The solution was simple to ugliness

it turned out that the file is created on the TV is stored only on the Mac encoding.
The solution was to create a UTF-8 sh file on Win, and then moved to TV folder in finished form ...

:)

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 6:09 pm
by zoelechat
Exactly :)


...Apple patented some charset!? :p

Re: SamyGo add locale UTF-8 in bash??

Posted: Wed Jun 01, 2016 6:48 pm
by sectroyer
lol :D Maybe we have different problems :D

Re: SamyGo add locale UTF-8 in bash??

Posted: Thu Jun 02, 2016 12:52 pm
by zoelechat
I focused on it and actually it's possible, but it implies custom libc and busybox, and absolutely no chance as long as you don't have true Telnet anyway (VDlinux shit is not). Not kind of stuff I'll make a tutorial... Here's at least proof :)

Code: Select all

/mnt # echo "?????????? ?? ????????"
?????????? ?? ????????
/mnt # locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
/mnt # locale -a
C
C.UTF-8
POSIX

Re: SamyGo add locale UTF-8 in bash??

Posted: Thu Jun 02, 2016 1:18 pm
by wluczykijwf
zoelechat wrote:[...] I'll make a tutorial... [...]
Awesome and I wait for it :)