Jump to content

Problem with text file in other language


techcone

Recommended Posts

Hello freaks :)

 

Here is my small problem, I have a text file in which some text in israel language is written, what I do is pick the contents for the file and post it on a site using curl.

 

Somehow, it is not posting it and showing gibberish characters.

 

Can please any one throw some light how to read the text file correctly in a string and how to encode it so that the text which is send correctly passed to the site ?

 

Thanks :)

Link to comment
Share on other sites

$file = mb_convert_encoding(file_get_contents("file.txt"), "ISO-8859-8");

 

Don't forget to include the following in the <head> tags of the HTML document you're attempting to display said text in:

 

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

Link to comment
Share on other sites

Well I guess you would have to encode it before writing, then write.

 

EDIT: Actually, don't quote me on this. I'm not sure, to be honest. Try writing without encoding, and see if things go according to plan.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.