Git Product home page Git Product logo

Comments (11)

meklu avatar meklu commented on July 20, 2024

Taking Content/*.

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

Taking Graphics/PackedVector/

I used the following bash script to autoconvert:

for f in *.cs; do iconv -c -f utf-8 -t ascii $f > $f.new; mv $f.new $f; done

Of course, change *.cs appropriately according to the folder if necessary.

For checking:

for f in *.cs; do file $f; done

from fna-mghistory.

meklu avatar meklu commented on July 20, 2024

This removes \uFEFF and \r as well.

git ls-files . | grep '\.cs$' | xargs -d $'\n' -n 1 -I '{}' \
sh -c 'iconv -c -f utf-8 -t ascii "$1" > "$1".new; sed -e "s/'$'\r''//g" "$1".new > "$1"; rm "$1".new' -- '{}'

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

I'll take Graphics/Vertices.

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

I'll take Input and Input/Touch too.

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

I'll keep going and take Media and Storage.

from fna-mghistory.

3vi1 avatar 3vi1 commented on July 20, 2024

I'll take Graphics

from fna-mghistory.

meklu avatar meklu commented on July 20, 2024

Wonder what on Earth I was thinking with that last snippet...
This one actually removes both \uFEFF and \r. In addition, it adds a trailing newline to any file that doesn't have one already, and translitterates non-ASCII symbols instead of truncating them. ("©" → "(C)")

git ls-files . | grep '\.cs$' | xargs -d $'\n' -n 1 -I '{}' \
sh -c 'iconv -c -f utf-8 -t ascii//TRANSLIT "$1" > "$1".new; sed -e "s/['$'\r'$'\uFEFF'']//g;\$a\\" "$1".new > "$1"; rm "$1".new' -- '{}'

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

I've found that the iconv -c -f utf-8 -t ascii "$1" takes out the \uFEFF so it's not explicitly needed in the sed command.

That said, the TRANSLIT is a good addition. I wasn't aware of that option.

from fna-mghistory.

khbecker avatar khbecker commented on July 20, 2024

I'm working on ./.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 20, 2024

Hooray, now I can edit MG-SDL2 with vim/gedit and not have to worry about dumb newline crap anymore. Thanks to everyone for covering this.

from fna-mghistory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.