How To Use Swedish Characters

Feb 3, 2012

I have a iPhone app called "Mina utgfter" where i put in data about my expenses.

From this app I export a csv file that I import to mysql database.

All is working just fine exept that when I have a swedish character in the csv file it will not be added in to the db and noting after that as well.

Ex: If i stand in csv file "Lönutrdag" only "L" will be added to db.

I know it has to do with utf-8 format but I can not get it to work.

The only solution i found so far is to open the csv file in notepad, take save as and save it as utf-8 format. Then everything works fine. But the problem with this is that I do this import from a webpage with asp and my users will import the file from there, so I want to skipp letting my users re-save the file in notepad.

I have tested to change the charset in db to latin swedins and ut-8 swedish but same problem. I tried to use ADODB.STREAM object in vb and open the csv file and save it with charset utf-8, but this resulted in that all the swedisn characters in the scv file became rubbish. I have no way to change format from the iPhone app, its just an export csv without and format options.

Tried to set the CHARACTER SET charset_name (utf-8) in the sql as well but same problem.

If I run the SQL "Load data in file..." in the code below in mysql directly I get same problem, so its not an asp error,

Here is my

<!--#include virtual="/Connections/connectionHome.asp" -->
Dim objConn,objRS,stmt
Set objConn=Server.CreateObject("ADODB.Connection")
set objRS=Server.CreateObject("ADODB.recordset")


I solved the problem my self.

1. Uninstalled mySQL from my server.
2. Installed MSSQL Express.


Utf 8 - Storing Swedish Characters In Database?

Mar 24, 2013

I'm having problems storing Swedish characters in my MySQL database. I want to store them in my table called users with the collation utf8-bin. Even though I'm using utf8, the characters å ä ö gets stored as Ã¥ ä ö and I don't know why. Retrieving the data and echoing it gives me the same output, with the weird characters instead of å ä ö.

View 3 Replies View Related

Php - Insert Gets Cut Off At First Swedish UTF-8 Character

Jan 3, 2013

When i try to insert some HTML code into my mysql database the text is cut at the first occurrence of å, ä or ö (Swedish letters). I don't know why this happens.

I run the following to ensure that the mysql connection is set up for UTF-8:

if(!mysql_set_charset('utf8', $link)) die(mysql_error());
$result = mysql_query("set names 'utf8'");

All of my php documents are coded in UTF-8. I ran mb_detect_encoding() on my string and it returned "UTF-8". My database has UTF-8 as default encoding and my tables are utf8_swedish_ci in collation (i also tried utf8_unicode_ci).

mysql returns no error. In my tables I get the part of the inserted string starting from 0 to the first occurrence of a Swedish char.

My insert function:

function mysql_insert($table, $inserts) {
$values = array_map('mysql_real_escape_string', array_values($inserts));
$keys = array_keys($inserts);
return mysql_query('INSERT INTO `'.$table.'` (`'.implode('`,`', $keys).'`) VALUES (''.implode('','', $values).'')');

If i remove the Swedish letters the whole string is inserted properly.

The query is very long:

INTO `content`

View 2 Replies View Related

Java - Storing UTF-8 Characters (specifically Russian Characters) In Database Using PreparedStatement

Jan 29, 2013

Using a prepared statement I am trying to store Russian characters in a field on a particular tables. The table and field is using the utf8 character set and utf8_bin collation.

If I manually run an insert via an IDE or command line, the string saves as expected.

INSERT INTO utf8Table VALUES('Анатолий Солоницын');

I am then able to query that table and can get back the expected String as well.

The Connection is setup through a resource in tomcat's context.xml file with the following config:



View 2 Replies View Related

Show Another Characters Instead Of Persian Characters By Connect In Android

Nov 26, 2012

Possible Duplicate: UTF-8 all the way through

I want to write a web application in android and use php to connect with mysql.this app is in Persian. when i connect to mysql only with php, I can see data in Persian(therfore my connection to mysql is true) but when i use this php in android app to connect to mysql, I don't get data in Persian.

View 1 Replies View Related

Php - UTF-8 Special Characters Inserting Into Table As Weird Characters?

Jun 27, 2013

This question already has an answer here:

UTF-8 all the way through my web application (Apache, MySQL, PHP, …)

11 answers

I searched in this site there were lots of answers but none of them are working for me. I am trying to parse the below XML using PHP simplexml_load_string.

My XML is:
<?xml version="1.0" encoding="utf-8"?>

When I print it using print_r the result is showing as below:

SimpleXMLElement Object
[name] => Peter
[country] => Großbritannien

and when I use ini_set('default_charset', 'UTF-8') or header('Content-Type: text/html; charset=utf-8') the result is:

SimpleXMLElement Object
[name] => Peter
[country] => Großbritannien

But When I try to insert the country value using PHP (with the header set as utf8) in the database (MySQL) then its inserting as Großbritannien. My tables character-set is UTF8 and collation of the column is utf8_unicode_ci. However when I directly insert the country value into the table(using phpMyAdmin or terminal) then its inserting properly.

I would like to know why the country value is not inserting properly from my PHP parsing page.

My PHP sample code is below:

$notificationXml = simplexml_load_string($xml);
$con = $notificationXml->country;
mysql_query("INSERT INTO test_1 (con) values ('$con')");

View 2 Replies View Related

How To SELECT A Field Without First N Characters And Last M Characters

Dec 14, 2012

I have a SELECT statement that is trying to view data from a single table. The data is encapsulated by HTML tags (<p> and </p>). For instance, one field might say:

<p>Lorem Ipsum</p>

How do I tell the SELECT statement to discount the first 3 characters and the last 4 characters?

View 2 Replies View Related

Php - X1a Characters Mean?

Apr 27, 2013

What does the x1a character mean and why does mysql_real_escape_string escape it?

From the documentation:

mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: x00, , , ', " and x1a.

A ASCII Characters reference describes it as Substitute character, but this doesn't say much.

View 4 Replies View Related

More Characters Than Specified In VARCHAR()?

Jan 26, 2012

If say, you were to set a table field to VARCHAR(5), and the user were to enter a string that is 6 characters long, how would MySQL react? Would it store the first 5 characters and ignore the last 6th character?

In the case that there is NO server side checking of course.

View 4 Replies View Related

Certain Characters Not Showing Up

Jan 27, 2013

Certain characters don't seemed to be displayed when I echo the data in PHP file. For example, the mdash (—) and the a with a tilde (which is necessary for certain places such as São Paulo). These show up as Is there any way to get them to show normally? I've tried surrounding them with `'s and putting \'s in front of them, but I can't seem to find out how to get them to work.

View 11 Replies View Related

End Characters Of GROUP_CONCAT Being Cut

Oct 27, 2010

I have a query where I have a concat nested inside a group concat. The problem I'm having is that the last x amount characters are being cut from the result. for example below at the end of the position column instead of finishing 'Position unknown' it finsihes 'Position'?


View 4 Replies View Related

Php - UTF-8 And German Characters

May 22, 2013

I have problem with German characters on my web site, in html/php part of website i have this code to set utf-8:

<meta charset="utf-8">

in mysql, i have this code to set utf-8


Here is some word on German: Gemäß

Here is how that word looks in mysql table:


Here is how that word is shown on the site: Gemäß

View 6 Replies View Related

Select Where The First Four Characters Are?

May 24, 2013

I have a database, in one of the fields occasionally I get an entry which starts off as

Is it possible using mysql and php to select only the rows from the field hostname where the first 4 characters = 'mail'?

View 4 Replies View Related

How To Add Non English Characters Using PHP

Mar 6, 2013

I can insert some non english languages ( indian languages) such as hindi malayalam etc.It display properly in PHPMYADMIN page.But when i open my webpage it appear as question mark.

View 1 Replies View Related

BETWEEN Is Exclusive On Right For Characters?

May 23, 2013

Consider this table named easy_drinks,

| drink_name |
| Kiss on the Lips |
| Hot Gold |
| Lone Tree |

A query as such, select drink_name from easy_drinks where drink_name BETWEEN 'G' and 'O';

results in

| drink_name |
| Kiss on the Lips |
| Hot Gold |
| Lone Tree |
| Greyhound |
| Indian Summer |
| Lime Fizz |

drink names starting with O are not included in the result. But as per the manual page expr BETWEEN min AND max

If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN >returns 1, otherwise it returns 0. I have been through questions that explain the behaviour for Timestamp and Date. What is the reason in this case?

View 2 Replies View Related

PHP - Special Characters - Ñ?

Jun 23, 2013

I have done a lot of thing to show the data in the database correctly. I have a device which inserts data into a MySQL DB with PHP scripts. All the data is shown correctly, but the special ones (Ñ, ó,é, etc...). I use JSON between the server and the device.

I have made many changes and these are the things I have got. First of all it only showed a "?" instead of the character (I?aki). Later It showed null for the full field and finally it shows nothing from the special character is written on.I have made the following changes but with no success:In the PHP Scripts:

header("Content-Type: text/html;charset=utf-8");
mysql_query("SET NAMES 'utf8'");

Besides, in the Database the string fields are in utf8_spanish_ci and the table collation in utf_unicode_ci.

I don't know what else can I do. If I insert a new row in the database I can see it perfectly in phpmyadmin and my device. The problem above happens when the device sends the parameters to the server and I suppose that the php script does not understand the special characters.

Edit: Here is the code for the PHP Script explained above:

header("Content-Type: text/html;charset=utf-8");
// array for JSON response
$response = array();


View 1 Replies View Related

Possible To GROUP BY First Two Characters Of Column?

May 8, 2010

I am looking to group a column that contains uk post codes. I can group the post codes using the following php/mysql format:


I would like to group them using only the first two characters from the 'pcode' column. E.g.:

NE11 2PP
NE22 2PP
NE33 2PP

SE34 1XB
SE44 1XB
SE55 1XB

would give me two groups - NE and SE

1: mysql code to achieve this
2: Later in the code I will need to loop through all of the 'pcode' groups to find out all of the codes that start with NE ...and then SE etc.

View 1 Replies View Related

Weird Characters In Database

May 18, 2012

I'm running a v bulletin forum, and we've recently migrated servers, moving from MySQL 4.1.22 to 5.0.95 in the process. Tonight I upgraded the v bulletin software from 3.8.4 to 3.8.7. Now I'm getting this odd message on one thread (that I know of)

Database error in vBulletin 3.8.7: Invalid SQL:

SELECT thread.threadid, thread.forumid, thread.title, thread.prefixid, thread.taglist, postusername, postuserid,

I've been looking into it all night, but as I'm a newbie I'm struggling loads. My character set looks like this

mysql> SHOW SESSION VARIABLES LIKE 'character_set%';
| Variable_name | Value |
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |

My Collation appears to be set to latin1_Swedish_ci (the site is English). I'm really stuck with this one as nothing I tried off Google seems to work. I think the problem is down to the random junk in between" 24744, 61387" but I don't know what that is or how to change it.

View 1 Replies View Related

Search Database Using Less Than 4 Characters?

Feb 26, 2010

I manage a website that is on an Apache server running MySQL 5.0.27.My website has a simple search functionality that uses a FULLTEXT search on the MySQL db, and it works fine.The owner of the site wants to be able to search for a minimum of 2 characters (instead of the default 4).It's my understanding that I would have to change the ft_min_word_len setting from 4 to 2 to accomplish this, and then restart the server, and rebuild my FULLTEXT indices.The problem is the website is on a "shared" server, so I'm doubtful my host will make any server-wide changes that would affect any other users.

How/What are my options if my host says they won't change the setting? Are there any other ways to "search" a MySQL database (utilizing PHP) and match a minimum of 2 characters?

View 2 Replies View Related

Replacing Characters In Query?

Mar 12, 2013

The purpose of this query was to search through the database and remove /, -, and from part numbers in the event that the user failed to input the special characters within the part number field.



This query, on MSSQL2008 returns the proper records.. however, when I ported my application over to MySql due to reasons beyond my control.. this function returns the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 18

Line 18 is the replacement function(s) and if I were to remove the number(s) between '%%' the error returned is the following:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%'' at line 18

Notice on both errors there is an extra ' at the end..

View 2 Replies View Related

Word Search Using Set Characters?

Jun 13, 2013

I have a DB that has English words. I want users to enter a string of characters and find only words containing those characters. Just like if they were to enter scrabble letters, it would let them know what words they can build off those letters.

User enters "sedal"
Then query would return:


View 6 Replies View Related

How To Load Foreign Characters

Jun 19, 2010

how do i load something like

into INNODB?

View 6 Replies View Related

Query For Non-English Characters?

Feb 16, 2013

i have column " details" in one table. that column stores email contents in HTML format , column data type is blob .my requirement to search and find any email content contains non -english characters ie foreign languages.

View 6 Replies View Related

CSV File Won't Take Special Characters

Dec 1, 2010

I have rows and rows of data in Chinese characters in Excel .xlsx file.  I need to import them into MySQL.  I tried saving .xlsx as .csv but it the characters explode.  Doesn't CSV support UTF-8?  I tried changing the font to "Unicode"b

View 2 Replies View Related

Use Special Characters In Entries?

Aug 30, 2010

OK, first let me say that I'm testing locally, using MYSQL version 5.1.36

I'm creating a site that is designed to me sort of an internal messaging system much like email but messages will only be able to be sent to other users within the system.  I've created a page to insert the message information into the database to be retrieved later and everything works perfectly until I use special characters that might normally be used in a message, such as apostrophes ( ' ).  The type of field is set as varchar 20000.  This is the only way that I know how to do it as I am learning as I progress.  What can I do to get mysql to accept the message, including the special characters that are used?

This is the error that I get when a special character is used:

Notice: Undefined index: grade in C:\wamp\www\insertmsg.php on line 40

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm going to see if this works.')' at line 1

View 2 Replies View Related

How To Accept All Special Characters For PHP

Aug 16, 2010

This is related to php and mysql both. Basically i want to accept all special characters on keyboard, store them in mysql database and display them through php on a webpage.

I have used stripslashes, addslashes, mysql_real_escape_string, etc but i am not sure how to use it in combination since i keep getting issues.

So this is to solve the problem all at once, if i get a correct syntax that can accept all spe. characters on keyboard?

eg: ~`!@#$%^&*()-=_+{}[]\|:";'<>?,./

Issue : Basically, i have created an article submission script but my boss seems to be using a hell of special characters in it,so i am tired finding which character is creating the issue and how to solve it. Article wont just display because of that one or some char.

View 11 Replies View Related

Remove Non-alphanumeric Characters

Jun 28, 2010

I'm looking for a function or something to remove non-alphanumeric characters from fields in a table. I need to run a comparison between fields in 2 tables, but the data in the fields often contains non-alphanumeric characters. I've been searching this forum (and Google) for a few days now, but only found this, which does not work for me at all, as when I try to enter this code, mysql complains about some syntax error (which to be honest, I can't find as I'm quite new to mysql).


View 6 Replies View Related

GROUP BY First Two Characters Of A Column?

May 8, 2010

I am looking to group a column that contains uk post codes.I can group the post codes using the following php/mysql format:


I would like to group them using only the first two characters from the 'pcode' column


NE11 2PP
NE22 2PP
NE33 2PP

SE34 1XB
SE44 1XB
SE55 1XB

would give me two groups - NE and SE

1: What is the mysql code to achieve this
2: Later in the code I will need to loop through all of the 'pcode' groups to find out all of the codes that start with NE ...and then SE etc.

View 1 Replies View Related

Count Characters In A Column

Oct 1, 2010

writing a query to count the character '<p>'  in the text_val coumn in the table "articles". And select the rows if count of '<p>' is only 2.

View 6 Replies View Related

Find Number Between Two Characters?

May 30, 2013

I have a column in one my tables which contains a sting something like this:


What I need to do is get ONLY the number between the first : and then second :. In this case my select would return 22.

View 2 Replies View Related

Special Characters In Query?

Feb 25, 2011

The variable includes special characters and I'm wondering if there is a way to still make it work? Since the variable has special characters, I get a SYNTAX error.

If I use double quotes inside the SQL command line around the variable in PhpMyAdmin, then it works, that's why I'm wondering how I can achieve a similar effect in PHP? Obviously I'm not able to use double quotes as shown below, and single quotes will give a syntax error.

View 4 Replies View Related

Copyrights 2005-15, All rights reserved