Closed ibra7002 closed 2 years ago
Maybe you could try iconv-lite, I've tried it, The results are good and there's no mistaken code.
yosion-p thanks so much for reply , but I can not put it in code can you give me example in Arabic thanks
I tried this , but doesn't work var iconv = require('iconv-lite'); var buffer = iconv.encode("شيشسي", "utf8"); var buf = iconv.decode(buffer, 'utf8');
buf always show this text ?????
sorry,I think you just needed to convert between a string and a buffer,it's will be ok.
var buffer = iconv.encode("شيشسي", "utf8");
you will get a Buffer
iconv.decode(buffer, 'utf8');
then you will get a string that before the conversion.
perhaps, i didn't catch what you want.
thanks for reply , I tried the code but still didn't work I don't know what is the problem
var iconv = require('iconv-lite');
var buffer = iconv.decode(iconv.encode('شيشسي', 'utf8'),'utf8');
return (
<header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light>
<Container>
<NavbarBrand tag={Link} to="/" >{buffer} </NavbarBrand>
did you add <meta charset='utf8'>
in <head>
?
like this:
Thanks for reply yes this line was at index.html at ClientApp\public folder but still doesn't work
did you get the Buffer? it's should be like this:
thanks for reply but this is the output
thanks for the help , I found the issue that package named reactstrap doesn't support Arabic
import React, { Component, Suspense } from 'react'; import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; import { Link } from 'react-router-dom'; import './NavMenu.css'; import { useTranslation } from "react-i18next"; import * as ReactBootStrap from 'react-bootstrap'; import { CustomProvider } from 'rsuite'; import ar_EG from 'rsuite/locales/ar_EG'; import utf8, { decode } from 'utf8';
/import { loading } from '../components/loading';/
export class NavMenu extends Component { static displayName = NavMenu.name;
constructor (props) { super(props);
}
toggleNavbar () { this.setState({ collapsed: !this.state.collapsed }); }
} }