Ukrainian character change to question mark when insert to table
Use nvarchar in your table and when you type your strings in the insert statement put N in front, like N'your string'. Also consider changing your collation due to sorting issues, refer to this question.
SQL Server returns question mark for some unicode chars
Because you're using a varchar
, not an nvarchar
. 'TレEホSᅯTル'
= 'T?E?S?T?'
as characters like レ
can't be stored in a varchar
.
Use a literal nvarchar
:
UPDATE MYTABLE SET UNICODEFIELD = N'TレEホSᅯTル';
Losing special characters on insert
Our DBA found the solution to this issue. The answer lay in a setting on the dbc connection on the bus to tell it to convert utf8 to NChar.
On The connection pool page add the following lines to the Properties box.
oracle.jdbc.convertNcharLiterals=true
oracle.jdbc.defaultNchar=true
this will allow you to be able to insert into NVarchar2 fields while maintaining the utf8 characters.
Cheers
Why can I store an Ukrainian string in a varchar column?
From MSDN:
Prefix Unicode character string constants with the letter
N
. Without
theN
prefix, the string is converted to the default code page of the
database. This default code page may not recognize certain characters.
UPDATE:
Please see a similar questions::
What is the meaning of the prefix N in T-SQL statements?
Cyrillic symbols in SQL code are not correctly after insert
sql server 2012 express do not understand Russian letters
Entity Framework Cyrillic displayed as question marks
I found the solution. It turns out that the data that comes out of the database is perfectly fine. The problem was in the displaying. I was using a console project for testing and it apparently didn't like the cyrillic font. Changing the font of the console fixed my problem.
Hibernate create record in russian language appears as question marks mysql
Check that Database tables has it also set.
Also a nice approach to distinguish if it's hibernate or DB problem would be to insert record via MySQL Workbench and check if it's saved correctly. If not - than definitely check table encoding, if yes, check that correct character encoding is really passed to hibernate (maybe you'll need jpa.properties.hibernate.
key)
why these is a question mark at the end of string
if you check
by pasting the
'www.myweb.com?q=id%3D'+convert(varchar(20),@id) +'%26action%3go'
in sql server query window you can see a non-dsplay character between go and '
remove that run the query. the question mark will go
mysql unicode text incorrect string warning on insert, despite character set variables set utf8mb4
The problem was the default system settings, which also affected the input settings at the command line.
Its a Japanese computer, which apparently uses shift-jis encoding using, NOT unicode, by default. The text I was inputting was encoded in this way, and in similar input files I was trying to use.
Therefore, I set the character set to be 'jsis' in the server,
i.e. setting character-set-server=sjis
in the my.ini initializer file, and set the mysql character set to be the same by entering skip-character-set-client-handshake
into the same initilization file.
The character set for the column of course must also be changed via
ALTER TABLE usert MODIFY username varchar(30) CHARACTER SET sjis COLLATE sjis_japanese_ci
Now, you can insert the japanese text from command line, and other japanese files which use shift-jis encoding.
Another option for inputting japanese text seems to be cp932, which is the windows version of shift-jis.
Incidentally, if you DO wish to use unicode via command line, apparently powershell has better support for it, rather than the normal cmd I was using, but I haven't tried it personally.
Related Topics
How to Enforce Set-Like Uniqueness Between Multiple Columns
SQL Server Max Statement Returns Multiple Results
Fastest "Get Duplicates" SQL Script
Sqllite Strftime Function to Get Grouped Data by Months
Postgres: How to Do Composite Keys
Insert Multiple Values Using Insert into (SQL Server 2005)
How to Concatenate Text from Multiple Rows into a Single Text String in Oracle Server
SQL Server Error: Column Name or Number of Supplied Values Does Not Match Table Definition
Is There a Difference Between a Select Statement Inside a Transaction and One That Is Outside of It
Teradata, Reset When, Partition By, Order By
How to Group by the Each Week Upto Last Six Week Sundays Dates in SQL