Skip to content

Instantly share code, notes, and snippets.

#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@nestorlafon
nestorlafon / gist:5206508
Last active December 15, 2015 05:09
Based on what I saw here http://michaelleo.com/blog/2011/12/xmppframework-ios-libidn-all_load-failure/ || Source code here: http://ftp.gnu.org/gnu/libidn/ || Compiled for i386, armv7 and armv7s with 6.1 SDK and 5.0 minimun SDK
./configure --host=i686-apple-darwin --disable-shared CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CFLAGS="-arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -Wunused-value -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=5.0" CPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar
make clean
make
cp lib/.libs/libidn.a libidn-i386.a
./configure --host=arm-apple-darwin --disable-shared CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CFLAGS="-arch armv7 -fmessage-length=0 -pipe -std=c99 -Wno-trigra
$ file ISO-8859-1.txt
ISO-8859-1.txt: ISO-8859 text
$ node iconvtest.js
DEBUG: Raw data from ISO file: Este es un texto en español donde tenemos acentos en la á y en otras vocales como la é,í,ó,ú. También hay otros símbolos pero con esto vale.
DEBUG: New input 10485760 bytes buffer created
DEBUG: 141 bytes written to iBuf in binary
DEBUG: siBuf size: 141
DEBUG: siBuf contents: Este es un texto en español donde tenemos acentos en la á y en otras vocales como la é,í,ó,ú. También hay otros símbolos pero con esto vale.
var host='www.educacion.es';
var uri='/404.html';
var sys = require('sys');
var http = require('http');
var Iconv = require('iconv').Iconv;
var Buffer = require('buffer').Buffer;
var httpcli = http.createClient(80, host);
var request = httpcli.request( 'GET', uri, {
request.on('response', function (response) {
//var responseBody = '';
var resBuf = new Buffer(10485760);
var resIdx = 0;
sys.debug('STATUS= ' + response.statusCode);
sys.debug('HEADERS= ' + JSON.stringify(response.headers));
//response.setEncoding('utf8');
response.setEncoding('binary');
response.on('data', function(chunk){