Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Wide-Latin bash script?

Name: Anonymous 2010-06-05 0:56

Is there any script, preferably bash or Perl, that will convert normal ASCII ("deal") into wide-width latin ("deal")?

Thanks.

Name: Anonymous 2010-06-05 19:14

>>39
You mean like http://harry.lu/mty/ ?

It does not work on the text-boards, only the image-boards.

Name: Anonymous 2010-06-05 19:17

>>41
I don't think you're as good at reading posts as you think you are.

Name: Anonymous 2010-06-05 19:22

>>42
|tripcode thread
|links to a tripcode producing program
I think I read it quite fine.

Name: Anonymous 2010-06-05 19:27

>>43
|
How utterly unsurprising.

Name: Anonymous 2010-06-05 19:40

| How utterly unsurprising.
This is more like it.

Name: Anonymous 2010-06-05 19:44

>>27
of course it doesn't work if you intentionally write broken code.
use encoding utf8;

Name: Anonymous 2010-06-05 20:47

>>46
Why, in this day and age, is any program not utf8 by default?

Name: Anonymous 2010-06-06 0:02

>>47
because not every program needs a bunch of bullshit code to handle a variable-length encoding.

Name: Anonymous 2010-06-06 15:49

Shocking, not nearly enough “Toy language” implementations. Here is my overly-engineered Scheme version

#!/usr/bin/env scheme-script
; Hey Emacs!, This is a -*- Scheme -*- file

;;; fullwidth.ss
; Takes n command line arguments, and returns n lines with each argument
; string converted to be fullwidth
; Example:
; fullwidth "can i play with magic?"
; => can i play with magic?

(import (rnrs) (only (srfi :13) string-map))

; figure out the offset
; notice that the first 'a' is fullwidth
(define offset (- (char->integer #\a)
                  (char->integer #\a)))

(define (char+ char int)
  (integer->char (+ int (char->integer char))))

(define fullwidth-symbols
  ; various other fullwidth symbols according to
  ; the unicode standard
  '((#\x00A2 . #\xFFE0)
    (#\x00A3 . #\xFFE1)
    (#\x00AC . #\xFFE2)
    (#\x00AF . #\xFFE3)
    (#\x00A6 . #\xFFE4)
    (#\x00A5 . #\xFFE5)
    (#\x20A9 . #\xFFE6)))

(define (char-fullwidth x)
  (cond ((char=? x #\space)
         #\ ) ;special case for fullwidth space
        ((char<=? #\! x #\~)
         (char+ x offset))
    ((assoc x fullwidth-symbols) => cdr)
        (else x)))

(define (string-fullwidth s)
  (string-map char-fullwidth s))

(define (main)
  (let ((argv (cdr (command-line))))
    (for-each (lambda (x)
                (display (string-fullwidth x))
                (newline))
              argv)))

(main)

Name: Anonymous 2010-06-06 16:11

>>49
Oh, fine.

module Main (main) where

import qualified System.IO.UTF8 as U

fullwidthConvert :: String -> String
fullwidthConvert = map fullwidthConvert'
    where
        fullwidthConvert' c = case lookup c table of
            Just c' -> c'
            Nothing -> c
            where
                table = zip (' ' : ['!'..'~'])
                            ('\x3000' : ['\xff01'..'\xff5e'])

main :: IO ()
main = U.getContents >>= U.putStr . fullwidthConvert

Name: Anonymous 2010-06-06 16:19

>>47
because some people don't care about gookspeak

Name: Anonymous 2010-06-06 17:35

: >wide ( str -- wide )
  [ [ 32 126 between? ]
    [ [ 32 = ] [ 65248 + ] [ 12288 ] smart-if* ]
    smart-when ]
  map ;

Name: Anonymous 2010-06-06 17:43

>>52
What is that? APL?

Name: Anonymous 2010-06-06 17:49

>>52
smart-if
Steve Jobs would be proud.

Name: Anonymous 2010-06-06 19:24

>>53
Looks like Factor.

(It makes you write better code.)

Name: Anonymous 2010-06-06 21:45

>>55
it is factor.

>>54
smart-if is what if should be.

Name: Anonymous 2010-06-06 21:51

>>53
you........ IDIOT

Name: Anonymous 2010-06-06 21:59

>>57
That's not even close to how ellipses work.

Name: Anonymous 2010-06-06 22:30

>>57
You FETUS!

Name: Anonymous 2010-06-06 22:32

>>59
I lol'd for no reason, and now I feel kind of aborted about it :(

Name: Anonymous 2010-06-07 5:12

>>52
that should be
: >wide ( str -- wide )
  [ [ 32 126 between? ]
    [ [ 32 > ] [ 65248 + ] [ 12288 ] smart-if* ]
    smart-when ]
  map ;

Name: Anonymous 2010-07-01 11:46

# bump

import sys, string
if len(sys.argv) > 1:
    orig = sys.argv[1]
else:
    orig = raw_input("Input a string to convert: ")

new = str()

for i in orig:
    if i == " ":
        new = new + unichr(0x3000)
    elif i in string.printable:
        new = new + unichr(0xFEE0 + ord(i))
    else:
        new = new + i

print new

Name: Anonymous 2010-07-01 13:00

FUCK YOUR MOTHER SIDEWAYS

Name: Anonymous 2010-07-01 13:39

Why are people still posting shit after the C implementation was posted?

Name: Anonymous 2010-07-01 13:49

>>64
* Why are people still posting shit after Xarn's implementation was posted?

Name: Anonymous 2010-07-01 13:52

>>65
It didn't use Allegro or Python; I doubt that.

Name: Anonymous 2010-07-01 13:53

>>66
Read his blog.

Name: Anonymous 2010-07-01 14:29

>>66
If you only know Xarn from two of the challenge threads, maybe you aren't in any position to identify his code.

Name: Anonymous 2010-07-01 14:34

>>67,68
I've read his blog, and that's where I got the information to write >>66. Go on, deny it.

Name: Anonymous 2010-07-01 14:38

Isn't it great that the author of the code makes more difference than the code itself?

Name: Anonymous 2010-07-01 14:39

>>52,56
How does smart-if work in Factor?

Name: Anonymous 2010-07-01 14:44

>>70
Dolt.

Name: Anonymous 2010-07-01 14:50

What about my a dolt?

Name: Anonymous 2010-07-01 14:58

>>70
Only if the author is Xarn.

Name: Anonymous 2010-07-01 14:59

>>72
And you are a Xarn.

Name: Anonymous 2010-07-01 15:00

y helo thar lol full−width romanji indeed

−−−

Posted from my iMac

Name: Anonymous 2010-07-01 16:01

It’ s ``romaji’’, not ``romanji’’,
you stupid ``馬鹿’’ (日本語 for ``Idiot’’)

Reference: 
http://img257.imageshack.us/img257/7140/nippon.png


−−−

Sent from my Mac Pro

Name: Anonymous 2010-07-01 16:29

y helo thar lol full−width jumanji indeed

Name: Anonymous 2010-07-01 17:16

Polecat kebabs

Name: Anonymous 2010-07-01 17:24

Ok, I'll have to resort to this:

>>52,56
How does smart-if work in Factor?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List