Local SQLite db? There shouldn't be a problem with saving string with special characters. Post an example if you aren't able to get it working.
Local and remore db. Sometimes onde, sometimes other.
[CODE lang="sql" title="Code to be saved as text"]
Drop Function If Exists remover_acentos;
Delimiter |
Create Function fn_remover_acentos( Texto VARCHAR(10000) ) RETURNS VARCHAR(10000)
Begin
Set @Texto = Texto;
-- Acentos
Set @ComAcentos = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';
Set @SemAcentos = 'SsZzAAAAAAACEEEEIIIINOOOOOOUUUUYYBaaaaaaaceeeeiiiinoooooouuuuyybf';
Set @Quantidade = Length(@ComAcentos);
While @quantidade > 0 Do
Set @Texto = Replace(@Texto, Substring(@ComAcentos, @Quantidade, 1), Substring(@SemAcentos, @Quantidade, 1));
Set @Quantidade = @Quantidade - 1;
End While;
-- Caracteres Especiais
Set @Especial = '!@#$%¨&*(^~)_±=§¹²³£¢¬"`´{*Erro*<,>.:;?/°ºª±*|\\';
Set @Quantidade = Length(@Especial);
While @Quantidade > 0 Do
Set @Texto = Replace(@Texto, Substring(@Especial, @Quantidade, 1), '');
SET @Quantidade = @Quantidade - 1;
End While;
Return @Texto;
End
|
Delimiter ;
[/CODE]
As for how to record and read SQLite text, I don't use anything special... The application is a code manager to help developers, storing functions, code snippets and manipulating them with various resources. The problem occurred when I tried to paste the code below (code for MySQL) so that it would be stored. It is a code that has characters specific to my language and symbols and the problem occurred in them. Here's what I want to store: