How to convert " half-width character " to " full-width character "
Question

Hi. I'm Esaki.


I am  trying to convert  a " half-width character " string to  a " full-width character " string.

e.g. "some characters" ? "some characters"


However,  I have no solution...

Would you please tell me some good solutions ?


Best regards,

Esaki


>e.g. "some characters" ? "some characters"

oh... maybe this system cannot display " full-width character " string.


>>? "some characters" is not the string that I try to display.

Hi Takahiro,

I think you can use the Replace Built-in Function to do that. Something like Replace("Country Details", " ","").

Regards,

Nuno Verdasca

Other example:

Trim End

Trim Start

Trim


Cheers,

Nuno Verdasca

> Nuro

Thank for your reply.


However, what I mean is not trimming a space.

Could you check the attachment file ?


Best regards,

Esaki


Hi Takahiro,
I think what you want to do is still right in Outsystems.

I advise you to do a loop, and work with indexes and in the end do a String_Join of everything.


Cheers,

Nuno Verdasca

Hello,

You can try to use the CSS "letter-spacing" property to the expression/text (example below):

.className {
          letter-spacing: 2px;
}

Thanks,
Tiago

mvp_badge
MVP

Hi Takahiro,

To add a space after every character, you could use a Regex_Replace from the Text Extension. For the Pattern, use "(.)", for the Replace, use "$1 ".

Hi Takahiro,

This is a logic for your problem:



Best regards,

Nuno Verdasca

mvp_badge
MVP

Hi Nuno,

I answered exactly the same already yesterday. Please read the previous responses!

Hello, The problem is not about the spacing between characters.

For Japanese character, there are 2 types:  

- "full-width character" such as "??" or  "abc" 

and " half-width character " such as "????" or "abc"

the problem is when searching in DB, if data containing full-width character like "abc" and user input "abc", the result will be null. 

We want to convert "abc" to "abc"  and vice versal. (full-width <=> haft-width ) and we don't know how to do it in outsystem

mvp_badge
MVP

Hi Giang,

Thank you for the explanation. I did some googling, but there doesn't seem to be an easy conversion from fullwidth to halfwidth and vice versa. Fullwidth variants of the latin alphabet and numerals have their own unicode range (as well as halfwidth variants of various Japanese and Korean characters). SQL Server can treat those as the same depending on its collation settings. If Width Sensitivity is set, they are treated as different, otherwise they are treated as the same.

So it's not a matter of how to do it in OutSystems, but how to get the database in width insensitive mode. If you are using an on-premise database, you should contact your DBA, otherwise (if you have an OutSystems PaaS solution), you should contact OutSystems support.

Thank you for your explanation. I am contacting the technical leader of my team to get advise from him in this case.

Thank you.

mvp_badge
MVP

Thank you too, without your explanation I wouldn't have read up on this. Quite interesting subject :). I hope you can get it resolved.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.