EzDevInfo.com

gibberish

Simple Ruby encryption module Documentation for mdp/gibberish (master)

PHP UTF8 mail gets garbled on iPhone mail app

I am using php internal mail function to send mail, I wrapped it up in a function which UTF8 the process, I found it online.

it works, I sent the email in the code to my GMAIL and to my EXCHANGE server, both in GMAIL and my Outlook client on my PC I get the message just right.

My iPhone is also connected to the exchange and GMAIL accounts, so I get both messages on my iPhone. the iPhone receives the GMAIL message correctly, but the EXCHANGE account shows the message with garbled gibberish text where no-latin characters are.

the example bellow sends Hebrew characters in the subject and in the body. On my iPhone, the subject gets received correctly in Hebrew, but the Hebrew parts in the body of the message are garbled.

can anyone comment on that ? maybe try it on your own setup ?

thanks,

<?php


function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') { 
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' .   "\r\n"; 
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);  
}

$mymessage = "Hello <BR>"; 
$mymessage.= "Received: now<BR/><BR/>";
$mymessage.= "details: שלום שלום<BR/><BR/>";

mail_utf8 ("XXX@gmail.com,XXX@exchangeServer.com", "שלום", $mymessage, "my_mail", "mailer@phpmail.com");


?>

Source: (StackOverflow)

Receiving some nonsensical spam - what is its purpose? [closed]

Technically this might not be classed as a programming question, since I have already implemented a solution. But it's an interesting issue in the tech field nonetheless.

Anyway... I set up a basic contact form, without any spam protection. On discovering that it wasn't working, I ignored it and set up a Javascript to change all links pointing to the contact page to use mailto: links instead. (I intended to replace the form with an appropriate message about contacting me.) I discovered yesterday that the form is now suddenly working, because I'm getting spam from it. Here's an example:

Message received from contact form.

Name: pvenvoqks
Email: allceh@bxyzsn.com

Message: Mx7orZ iafgvohkzxmv, [url=http://wxmrsloamyhf.com/]wxmrsloamyhf[/url], [link=http://gloukuwmttnj.com/]gloukuwmttnj[/link], http://vmekxmqouktx.com/

It's obviously just gibberish. I checked the links and they don't work. It seems like there is a robot just submitting random data in forms - although note that it managed to pick up that an email should be submitted in the appropriate field.

My question is, is this spam trying to serve a purpose? I would understand if the links led to real websites for meds or malware or something, but they don't. It just seems totally random.

Aside: if anyone is interested, I used the "hidden field" solution to combat the spam. I used a hidden field called "Website", which, if filled in, does not send the email.


Source: (StackOverflow)

Advertisements

fread() puts weird things into char array

I have a file that I want to be read from and printed out to the screen. I'm using XCode as my IDE. Here is my code...

fp=fopen(x, "r");
char content[102];
fread(content, 1, 100, fp);
printf("%s\n", content);

The content of the file is "Bacon!" What it prints out is \254\226\325k\254\226\234.

I have Googled all over for this answer, but the documentation for file I/O in C seems to be sparse, and what little there is is not very clear. (To me at least...)

EDIT: I switched to just reading, not appending and reading, and switched the two middle arguments in fread(). Now it prints out Bacon!\320H\320 What do these things mean? Things as in backslash number number number or letter. I also switched the way to print it out as suggested.


Source: (StackOverflow)

php code turned gibberish?

I went to edit this PHP file - it's supposed to generate those captcha security images on contact forms - the images werent working, so I was going to see if there was a broken path or something i could fix simply.

But when I opened the file it looked like this: http://mydomainsample.com/explosion/screenshots/Screen%20Shot%202012-05-17%20at%209.34.14%20AM.png

complete gibberish.

Is it possible this happened somehow while downloading the file from the server? I did not have ftp access to the site originally - we got control of the domain and transferred it from one host to another.

I used site sucker to backup the site before transferring, but it downloads php files as html files. you end up with filename.php.html.

in the past this has never turned the php into incomprehensible gibberish, so i dont understand why it did now.


Source: (StackOverflow)

File ReadAllLines turns foreign language into gibberish (�)

I am creating a tool that replaces some text in a text file. My problem is that File ReadAllLines turns the Hebrew characters into Gibberish (weird question marks �)

Does anyone know why this is happening? Note that I do have a problem with Hebrew in games and such.. And in Notepad, I can't save Hebrew documents. I can write Hebrew letters but when I save it tells me there's a problem with that.

EDIT - Tried this, but it only turned the Hebrew into regular question marks and not "special" ones-

string[] lines = File.ReadAllLines(fullFilenameDir);
byte[] htmlBytes = Encoding.Convert(Encoding.ASCII, Encoding.Unicode, Encoding.ASCII.GetBytes(String.Join("\r\n", lines)));
char[] htmlChars = new char[Encoding.Unicode.GetCharCount(htmlBytes)];
Encoding.Unicode.GetChars(htmlBytes, 0, htmlBytes.Length, htmlChars, 0);

Source: (StackOverflow)

Displaying hebrew characters with SQL collation SQL_Latin1_General_CP850_BIN2

We have a remote database that is out of our control. The database contains Hebrew characters. It's collation is: SQL_Latin1_General_CP850_BIN2

When we open the SQL management studio - we see gibberish.

We asked the database owner (a different company) to change the collation and it isn't possible.

Is there an alternative way to see Hebrew characters with this collation setting

Thank you Yaron


Source: (StackOverflow)

When querying a MySql DB VBScript is returning asian characters instead of English

I am using VBScript to query a MySQL database that contains only English characters. The query is basically: SELECT * FROM table name PROCEDURE ANALYSE(1,1)

When I run the query directly on the DB it returns the expected results. However, when the query is run through VBScript it returns gibberish (Chinese?). I know for a fact the DB only contains English as I am the one who built it. I've run numerous other queries against the same table and haven't had any problems. Its only when I run the PROCEDURE ANALYSE query that it returns something unexpected.

The VBScript code is as follows:

strSQLcommand = "SELECT * FROM " & strTempTableName & " PROCEDURE ANALYSE(1,1)"
otRecordset.Open strSQLcommand,Connection

If Not otRecordset.EOF Then
otRecordset.movefirst
Do While NOT otRecordset.EOF
wscript.echo otRecordset(0).value
wscript.echo  otRecordset(1).value
otRecordset.Movenext
Loop
End If

I've never had a problem with returning values from any other table in this DB. I've run this query numerous times and always get the same results which has me perplexed.

Any thoughts or ideas are greatly appreciated!


Source: (StackOverflow)

Scanner in JAVA outputs gibberish instead of Hebrew

I have a problem with scanning Hebrew in Netbeans. I am trying to Scan the user's input and present in the Console, but it appears as Gibberish.

My code is:

 public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    System.out.println("Please input:");
    System.out.println("Your input is: " + input.next());
}

and this is the Console:

run:

Please input:

שלום

Your input is: ����

BUILD SUCCESSFUL (total time: 3 seconds)

The same exact code works perfectly on Eclipse. If I Println() a hebrew word it also works fine, so it's not an encoding problem. (I am using Netbeans 7.3.1)

Thank you very much,

Barak.


Source: (StackOverflow)

Trying to read from a URL(in Java) produces gibberish on certain occaisions

I'm trying to read from a URL, and then print the result.

BufferedReader in = new BufferedReader(
     new InputStreamReader(new URL("http://somesite.com/").openStream(), "UTF-8"));
String s = "";
while ((s=in.readLine())!=null) System.out.println(s);
in.close();

It works great most of the time, and prints the website's source. However, my problem is, on specific websites, instead of the source code, it will print out gibberish, such as symbols and other unusual characters.

Is there some property that varies from website to website that would affect how it is read? The page loads just fine in Firefox, and I can view the source there with no problem. If firefox can access the source, I should be able to as well; I'm just not sure why it isn't working...

EDIT: added "UTF-8" to InputStreamReader. All of the strange characters are now question marks...still not working...


Source: (StackOverflow)

PHP adding gibberish to strings passed into mysql_query

in PHP, I'm using mysql_query($querystring) to insert some information into a table.

However, when I look at the MySQL Query Logs, it shows that gibberish is getting added:

MySQL Log:

INSERT INTO database.table 
SET
`col1` = '0^@0^@:^@0^@0^@:^@1^@8',
`col2` = '3^@8^@0',
`col3` = '3^@6^@8',
`col4` = '1^@2'

When I do a var_dump() on $querystring, everything looks fine, no ^@ are appended.

PHP var_dump() - Note: I just made up the 333 number.

string(333) "INSERT INTO database.table 
SET
`col1` = '00:00:18',
`col2` = '380',
`col3` = '368',
`col4` = '12'"

However, the MySQL logs are showing the ^@. Is there any way to strip the ^@ from the $querystring?

The values stored in the database are '00:00:00' (the default value for that field), '3', '3', and '1'. Col1 is of type date, and Col2-4 are smallint(5).


Source: (StackOverflow)

Javacc Package Problems

We are implementing a version of gibberish using javacc to build our abstract syntax tree. We have many classes implemented in java that are called by our Parser.jj program. However, Parser.jj doesn't recognize any of the classes implemented even though they are in the same folder / package (e.g. Error: cannot find symbol: class VariableNode). Is there a way to get Parser.jj to recognize those files?

Thanks for the help!


Source: (StackOverflow)

Algorithm or tool in python to distinguish between gibberish/errors and foreign words/names?

I'm doing some machine extraction of sometimes-garbled PDF text, which often ends up with words incorrectly split up by spaces, or chunks of words put in incorrect order, resulting in pure gibberish.

I'd like a tool that can scan through and recognize these chunks of pure gibberish while skipping non-dictionary words that are likely to be proper names or simply words in a foreign language.

Not sure if this is even possible, but if it is I imagine something like this could be done using NLTK. I'm just wondering if this has been done before to save me the trouble of reinventing the wheel.


Source: (StackOverflow)

dotConnect for Oracle Hebrew problem - gibberish - getting ¿¿¿¿

I'm trying to create EF through Devart dotConnect with an Oracle database that includes Hebrew chars.

In regedit:

NLS_LANG = HEBREW_ISRAEL.IW8ISO8859P8 

In web.config:

<system.web>
   <globalization requestEncoding="windows-1255"
      responseEncoding="windows-1255" fileEncoding="windows-1255"
      culture="he-IL" uiCulture="he-IL" />
</system.web>

In Master:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I'm getting " ¿¿¿¿" instead of real values. You can I fix it?


Source: (StackOverflow)

Powershell: After using Out-File, Robocopy will append a bunch of gibberish to the same log file

I need to write to a particular log file, and append the results of multiple robocopy commands to the end of that file.

The trouble is, when the robocopy is preceded by an out-file command, the robocopy writes a bunch of random characters to the log. My guess is that the log is still in use by the previous out-file command, but from what I could find about it, out-file is supposed to create, open, and close files automatically.

Here is a slimmed down example of what I'm trying to do:

"lala" | Out-File -filepath log.txt
robocopy .\source .\destination 1.txt /log+:log.txt

In the above example, the log is created, and the contents look like this:

lala ਍ⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭഭ †佒佂佃奐††㨠›††潒畢瑳䘠汩⁥潃祰映牯圠湩潤>獷†††††††††††††††਍ⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭⴭഭഊ 匠慴瑲摥㨠䴠湯䴠牡>

etc.

Commenting out the first line and using only the robocopy command works just fine, but if I add the first line, the log gets messed up again. Anyone have any ideas/wisdom for me?

Thanks for reading. d:- D


Source: (StackOverflow)

firefox addon development and Unicode

So I started developing my firefox addon. Most of the work is performed by a referenced javascript file. Problem is that when I edit some of the html elements on the page and say, set their text it's written as pure giberish. I am writing the text in hebrew. Can't for the life of me figure the reason.

Any ideas?


Source: (StackOverflow)